httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sutton <p...@ukweb.com>
Subject multi log support
Date Fri, 05 Jul 1996 07:57:55 GMT
I've updated the config log module to be able to log to multiple log
files. This means it can effectively replace the referer and user-agent
log modules with a single line the config files, as well as making it
_much_ easier to add new custom log files, or change the format of these
logs (which at present requires code-hacking in the mod_log_* modules).

The module should be upwardly compatable with existing configs based on
either the common log or config log modules. It implements the existing
TransferLog and LogFormat directives. The only difference here is that
TransferLog can be given more than once and each request will be logged to
_all_ the log files. For example, to log request to two files in CLF
format, use:

  TransferLog logs/access_log
  TransferLog logs/another_access_log

As with the config log, LogFormat can be used to set the format for these
logs. Logging to two files in the same format isn't too useful, the
usefulness of this module comes from being able to log to multiple log
files in different format. To do this it adds a new directive CustomLog.
To log to a CLF file, and also keep a log of referers and user-agents, use

  TransferLog logs/access_log
  CustomLog   logs/referer    "%{referer}i -> %U"
  CustomLog   logs/agent      "%{user-agent}i"

Every request will now be logged to all three files, and it is trivial to
either add new log files, or change the format of the custom logs.  (The
%U is a new token to log the requested URI).

The referer and agent logs are not quite exactly the same as produced by
the existing modules: there is no RefererIgnore, and if the user-agent is
missing it is logged as '-' rather than ignored as with the agent log.
However I think the easy of use of this method of specifying multiple
custom log files makes up for this (alternatively, we could add some sort
of conditional-logging code).

Anyway, I've uploaded the module at mod_log_multi.c to httpd/incoming on
hyperreal.

Paul


Paul




Mime
View raw message