httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject RE: Filter the access_log on the fly (SetEnvIf and CustomLog question)
Date Fri, 18 Jan 2002 04:14:18 GMT
> # Mark requests from: http://validator.w3.org
> SetEnvIf Remote_Addr "18\.29\.1\.50" validator=1
> # Mark requests from: http://server.htmlhelp.com
> SetEnvIf Remote_Addr "64\.29\.16\.182" validator=1
> CustomLog /usr/local/apache/logs/validator_log common env=validator
> SetEnvIf Request_URI .png$ images=1
> CustomLog /usr/local/apache/logs/images_log common env=images
> SetEnvIf validator 1 gotit
> SetEnvIf images 1 gotit
> CustomLog /usr/local/apache/logs/access_log combined env=!gotit

Actually, just to be pedantic, this is slightly more efficient because it
cuts down on the number of regex evaluations:

SetEnvIf Remote_Addr "18\.29\.1\.50" validator nolog
SetEnvIf Remote_Addr "64\.29\.16\.182" validator nolog
SetEnvIf Request_URI .png$ images nolog

CustomLog /usr/local/apache/logs/validator_log common env=validator
CustomLog /usr/local/apache/logs/images_log common env=images
CustomLog /usr/local/apache/logs/access_log combined env=!nolog

Joshua.

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message