httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <>
Subject Re: [PATCH] Disabling logging based on envariable
Date Fri, 15 Aug 1997 22:32:38 GMT
On Fri, 15 Aug 1997, Rob Hartill wrote:
> Assuming this patch doesn't disable logging to specific logs, how about
> something like this..

I think creating another sectioning directive just for log file definition
is probably a little over the top. I would prefer to acheive this
functionality using SetEnvIf and a "CustomLogIf" directive. But it may not
be possible in all the cases you describe below..

> <Logfile>
> 	LogFormat "%h - %u %t \"%r\" %s %b"
> 	LogUnless env=that_bloody_robot_again
> </Logfile>

CustomLogIf that_bloody_robot_again logs/access_log "%h - %u %t \"%r\" %s %b"

> <Logfile>
> 	CustomLog logs/kaboom "%h - %u %t \"%r\" %s %b \"\" \"%{User-agent}i\""
> 	LogIf status>=500
> </Logfile>

Would be nice to be able to say:

SetEnvIf    REQUEST_STATUS /^5/ is_error
CustomLogIf is_error logs/kaboom "%h - %u %t \"%r\" %s %b \"\" \"${user-agent}i\""

but of course SetEnvIf is processed way too early. Um.

> <Logfile>
> 	CustomLog logs/referer "%{referer}i -> %U"
> 	LogIf env=referer_exists
> 	LogUnless env=referer_is_not_local
> </Logfile>

SetEnvIf    Referer /./                  referer_is_not_local
SetEnvIf    Referer /\.my_local_dom\//  !referer_is_not_local
CustomLogIf refer_is_not_local logs/referer "%{referer}i -> %U"

Use of various combintions of SetEnv and SetEnvIf can be used to implement
some form of conditional and boolean logic to logging (and other things,
such as deny from env=xxx).


View raw message