Forum Moderators: phranque
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
# You need to enable mod_logio.c to use %I and %O
#LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog logs/access.log common#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#
#CustomLog logs/referer.log referer
#CustomLog logs/agent.log agent#
# If you prefer a single logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog logs/access.log combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" \"%{cookie}i\"" combined# Specify that we want to store the combined log file in the location "logs/combined.log".
CustomLog logs/combined.log combined
So here is what I think I should do :). Uncomment the CustomLog logs/access.log combined line and add the LogFormat line. Except Im confused over the multiple LogFormat lines that are in bold above. Do I just add my new LogFormat or do I need to comment/remove the old LogFormats?
And finally Im not sure I understand the CustomLog logs/access.log common. Do I just leave that as is?
Any help would be appreciated.
just comment the old "combined" logformat
add your new "combined" logformat
and change CustomLog to your new "combined" format:
CustomLog logs/access.log combined
I'm not sure if you have to comment the old
LogFormat ... combined
but commenting this out will keep your config clear.
you can test it by # httpd -t