Forum Moderators: phranque

Message Too Old, No Replies

conditional logging

         

alluoshi

1:20 am on May 1, 2009 (gmt 0)

10+ Year Member



Hi, I need to log only the requests that contain the word "apple" in their URL.
I tried SetEnvIf Request_URI "apple" but it didn't work. It didn't log anything. How can I fix this?

jdMorgan

3:00 am on May 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



 SetEnvIf Request_URI "apple" 

is missing the name of the variable you want it to set, so it is invalid.

You likely want to set a uniquely-named variable by using something like:

 SetEnvIf Request_URI "apple" log-my-apples

and then use that in your conditional-logging LogFormat or CustomLog directive (See Apache mod_log_config [httpd.apache.org])

Jim