httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elizabeth Mattijsen <...@xxLINK.nl>
Subject Re: [PATCH] Disabling logging based on envariable
Date Sun, 17 Aug 1997 16:55:15 GMT
Pardon me if this has come up before and pardon my ignorance if this is
completely off the wall (although I would definitely would like to know
why, then):

Wouldn't it be a good idea to handle the conditional logging through the
mod_rewrite module?  Using the same concept as the rewrite map but applied
to the format in which logging should occur, and another flag, this could
be a solution...


For example:

LogFormat	"%h - %u %t \"%r\" %s %b"	BadRobots

would define the log format "BadRobots".


An extra flag, e.g. O, would allow you to specify the log format and/or
logfile in which to log.


Then, together with a RewriteCond, you could do the following:

RewriteCond		%{REMOTE_ADDR)	123.123.123.*
RewriteRule		^.*\.htm$		[L,O=BadRobots:logs/badrobotlog]

If no log format is specified, the last specified LogFormat would be used.
If no filename would be given, the last used TransferLog would be used.

Also, by saving the log format into a separate entity, it would be nice if
it were possible to re-use the log format at several places (something that
I would like to be able to do with my 150+ Virtual Host setup anyway).  So
you could do a:

LogFormat	Extended	"%h %l %u %t \"%r\" %s %b \"%{Referer}i\"
\"%{User-agent}i\""

in the beginning of the configuration, and then do a:

LogFormat	Extended

whenever the extended log format would be needed.


Hope this made sense...


Elizabeth Mattijsen
xxLINK Internet Services

Mime
View raw message