httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <p...@ukweb.com>
Subject Re: Putting the date into the referer log.
Date Thu, 24 Oct 1996 08:51:54 GMT
On Wed, 23 Oct 1996, Brian Behlendorf wrote:
> On Wed, 23 Oct 1996, Michael Smith wrote:
> > I guess I could go for adding ConfigIgnore to mod_log_config and then
> > keeping two logs.  In fact by this approach, mod_log_referer could
> > vanish couldn't it?
>
> Be careful of the slippery slope of turning the configurable logfile language
> into a full on language... first it'll be ConfigIgnore for some pattern match
> against the output, then it'll be ConfigIgnore for some pattern match against a
> particular variable, then we'll want to conditionalize based upon an or'd
> comparison of two variables, and then... we'll end up with a pretty full
> language on our hands, developed in the worst possible way, by committee and
> piecemeal.

I agree about being careful here, but I think there is a case for adding a
directive to set an env var based on artibrary headers, a generic form of
BrowserMatch. The generic functionality will be useful with far more than
just config logs.

Being able to ignore certain hosts when logging is a pretty common
request. The problem is that since config_log can now create multiple
logs, a simple LogIgnore directive won't work -- we probably want to be
able to configure different log files differently.

I think the way to do this is to employ the BrowserMatch idea... set an
env var, and make TransferLog & CustomLog only log if a variable is set
(or not set).  You'd need to be able to set an env var based on the remote
host name, though. Something like:

   RefererMatch .local.com forgetme
   RefererMatch .myisp.com forgetme

   TransferLogIf !forgetme logs/referer

to not log referrals from the local sites.

Now, I don't like the idea of RefererMatch much, since you'd have to add
directives for all sorts of matches (HostMatch to ignore requests from
particular hosts, for instance). Perhaps a generic env var setting
directive is needed, which can access all the request headers and other
attributes (such as the remote hostname/IP), and do regexp matching, e.g.

  If remote_host = .local.com local
  If remote_host = .myisp.com local

  TransferLogIf  local logs/access_log.local
  TransferLogIf !local logs/access_log

Then of course this would also be accessible to CGI's (just like the
BrowserMatch stuff), so they could easily check for 'local' accesses (if
($ENV{local}) { print "Internal information here... " } ).

Paul
UK Web


Mime
View raw message