Recipe 3.1 Getting More Details in Your Log Entries

Problem

You want to add a little more detail to your access log entries.

Solution

Use the combined log format, rather than the common log format:

CustomLog logs/access_log combined

Discussion

The default Apache logfile enables logging with the common log format, but it also provides the combined log format as a predefined LogFormat directive.

The combined log format offers two additional pieces of information not included in the common log format: the Referer (where the client linked from) and the User-agent (what browser they are using).

Every major logfile parsing software package is able to handle the combined format as well as the common format, and many of them give additional statistics based on these added fields. So you lose nothing by using this format and potentially gain some additional information.

See Also

  • http://httpd.apache.org/docs/mod/mod_log_config.html

  • http://httpd.apache.org/docs-2.0/mod/mod_log_config.html



Apache Cookbook
Apache Cookbook: Solutions and Examples for Apache Administrators
ISBN: 0596529945
EAN: 2147483647
Year: 2006
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net