 
mod_log_config: configurable log module.

This is module implements the TransferLog directive (same as the
common log module), and an additional directive, LogFormat.

It should not be used together with the mod_log_common module
because both of them will write to the transfer log.

The argument to LogFormat is a string, which can include literal
characters copied into the log files, and '%' directives as follows:

%...h:  remote host
%...l:  remote logname (from identd, if supplied)
%...u:  remote user (from auth; may be bogus if return status (%s) is 401)
%...t:  time, in common log format time format
%...r:  first line of request
%...s:  status.  For requests that got internally redirected, this
        is status of theoriginal* request --- %...>s for the last.
%...b:  bytes sent.
%...{Foobar}i:  The contents of Foobar: header line(s) in the request
                sent to the client.
%...{Foobar}o:  The contents of Foobar: header line(s) in the reply.

The '...' can be nothing at all (e.g. "%h %u %r %s %b"), or it can
indicate conditions for inclusion of the item (which will cause it
to be replaced with '-' if the condition is not met).  Note that
there is no escaping performed on the strings from %r, %...i and
%...o; some with long memories may remember that I thought this was
a bad idea, once upon a time, and I'm still not comfortable with
it, but it is difficult to see how to "do the right thing" with all
of '%..i', unless we URL-escape everything and break with CLF.

The forms of condition are a list of HTTP status codes, which may
or may not be preceded by '!'.  Thus, '%400,501{User-agent}i' logs
User-agent: on 400 errors and 501 errors (Bad Request, Not
Implemented) only; '%!200,304,302{Referer}i' logs Referer: on all
requests which didnot* return some sort of normal status.

The default LogFormat reproduces CLF; see below.

The way this is supposed to work with virtual hosts is as follows:
a virtual host can have its own LogFormat, or its own TransferLog.
If it doesn't have its own LogFormat, it inherits from the main
server.  If it doesn't have its own TransferLog, it writes to the
same descriptor (meaning the same process for "| ...").

That means that you can do things like:

<VirtualHost hosta.com>
LogFormat "hosta ..."
...
</VirtualHost>

<VirtualHost hosta.com>
LogFormat "hostb ..."
...
</VirtualHost>

... to have different virtual servers write into the same log file,
but have some indication which host they came from, though a %v
directive may well be a better way to handle this.

 
