Forum Moderators: phranque

Message Too Old, No Replies

Excluding from Logs

Some problems with SetEnvIf

         

Blade

12:15 pm on Feb 23, 2003 (gmt 0)

10+ Year Member



Hi,

Reading other posts here about excluding info in the server log 'access_log', I have tried the following in my httpd.conf to exclude a certain directory. The problem is whatever I try, the info is still being logged!


Directory and everything in the directory to exclude: mysite.com/main/hits/

SetEnvIf Request_URI /main exclude
SetEnvIf Request_URI /main/hits/.* exclude

Curiously, similar directives that are excluding paths in the cgi-bin are working ok, but this directory is in the document path.

hakre

5:35 pm on Feb 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi Blade,

this piece is directly out of the apache docs:

# Mark requests from the loop-back interface
SetEnvIf Remote_Addr "127\.0\.0\.1" dontlog
# Mark requests for the robots.txt file
SetEnvIf Request_URI "^/robots\.txt$" dontlog
# Log what remains
CustomLog logs/access_log common env=!dontlog

did you use the CustomLog directive with it's env=!dontlog (or similar) condition? in your case dontlog should be exclude.

otherwise, only setting the environment variable only won't make the game.

Blade

5:54 pm on Feb 23, 2003 (gmt 0)

10+ Year Member



Hi thanks,

Yes I have the CustomLog directive and sucsesfully block some files from been logged. The snippet from apache doesn’t help much as that applies to individual files and the loop-back. What I need is certain directorys not logged but is somewhat more difficult than first thought!.

According to my research though, my above lines should work but they don’t!