LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   General (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=25)
-   -   Format of log (http://www.litespeedtech.com/support/forum/showthread.php?t=6047)

damienm 06-27-2012 11:21 AM

Format of log
 
Hi,

for the log format the server states

"The syntax of log format is compatible with Apache 2.0's custom log format."

However it appears some things are unsupported, or have bugs?

Per the apache 2.0 documentation there are some things not functioning.
http://httpd.apache.org/docs/2.0/mod...g.html#formats

1) I am interested in outputting environmental variables after setting them in a rewrite, for example:

%{FOOBAR}e

From apache:
"%...{FOOBAR}e The contents of the environment variable FOOBAR"

I can never get the variable output in the log though I can confirm it is set in the environment.

2) I also wish to use the < > modifiers with %U

%>U and %<U

From apache:
"The modifiers "<" and ">" can be used for requests that have been internally redirected to choose whether the original or final (respectively) request should be consulted. By default, the % directives %s, %U"

The modifiers seem to have no effect.

cheers for your assistance

NiteWave 06-27-2012 06:20 PM

1) try in .htaccess

RewriteRule \.php$ - [E=isPHP:1]

this set environment variable "isPHP"

in log format, add %{isPHP}e

will look into 2) later.

NiteWave 06-27-2012 08:41 PM

my test result regarding 2) on latest 4.1.13:

%<U --- not work, will simply leave U in log file
%U equal to %>U, the final request URI.

test env:
.htaccess:
RewriteRule abc.html test.php

when access 127.0.0.1/abc.html?c=3&d=5, the log for "%r" %<U %U %>U is:
"GET /abc.html?c=3&d=5 HTTP/1.1" U /test.php /test.php
i.e.,
"%r" --> "GET /abc.html?c=3&d=5 HTTP/1.1"
%<U --> U
%U --> /test.php
%>U --> /test.php


All times are GMT -7. The time now is 05:43 AM.