W3C httpd manual

Logging Control In W3C httpd

W3C httpd can log all the incoming requests to an access log file. It also has an error log where internal server errors are logged. All log files are generated using the common log file format that several WWW servers use. This provides the possibility of using some of the generic statistics programs to analyze the log file contents.

Access Log File

Access log file contains a log of all the requests. The name of the log file is specified either by -l logfile command line option, or with AccessLog directive; log file can be either an absolute path:
        AccessLog /absolute/path/logfile
or relative to ServerRoot:
        AccessLog logs/logfile

Proxy Access Log File

If you are running W3C httpd as a proxy server and you want to have a separate log of proxy transactions and normal HTTP server transactions, specify the proxy log file via ProxyAccessLog directive:
        ProxyAccessLog  logfile
logfile can be either an absolute pathname, or relative to ServerRoot.

If ProxyAccessLog is not set all accesses will be logged to the normal AccessLog instead.


CacheAccessLog

Cache accesses can be logged to a different log file instead of the normal access log. The CacheAccessLog directive takes an absolute pathname of the cache access log file:
        CacheAccessLog  logfile
logfile can be either an absolute pathname, or relative to ServerRoot.


Error Log File

Error log contains a log of errors that might prove useful when figuring out if something doesn't work. Error log file name is set by ErrorLog directive:
        ErrorLog /absolute/path/errorlog
If error log file is not specified, it defaults to access log file name with .error extension. If the filename extension already exists, .error will replace it.


LogFileDateExt

The LogfileDateExt directive specifies a common extension to all the log files based on a time/date format. The value follows the LogTime directive. Any format can be specified using time/date directives as specified for strftime() function, e.g.
	LogFileDateExt	%H:%M		=>	19:35
	LogFileDateExt	%d-%m-%Y	=>	02-18-95
Spaces in the format are converted to '_'.
	LogFileDateExt	log

Log File Format

Previously every server used to have its own logfile format which made it difficult to write general statistics collectors. Therefore there is now a common logfile format (which will eventually become the default). Currently it is enabled by
        LogFormat  Common
The old W3C httpd format can be used by
        LogFormat  Old

The Common Logfile Format

The common logfile format is as follows:
    remotehost rfc931 authuser [date] "request" status bytes
remotehost
Remote hostname (or IP number if DNS hostname is not available, or if DNSLookup is Off.
rfc931
The remote logname of the user.
authuser
The username as which the user has authenticated himself.
[date]
Date and time of the request.
"request"
The request line exactly as it came from the client.
status
The HTTP status code returned to the client.
bytes
The content-length of the document transferred.

Log Time Format

Times in the log file are by default local time. That can be changed to be GMT time by LogTime directive:
        LogTime  GMT
Default is:
        LogTime  LocalTime

Suppressing Log Entries For Certain Hosts/Domains

It's not always necessary to collect log information of accesses made by local hosts. The NoLog directive can be used to prevent log entry being made for hosts matching a given IP number or host name template:
        NoLog  template

Examples

        NoLog 128.141.*.*
        NoLog *.cern.ch
        NoLog *.ch  *.fr  *.it


httpd@w3.org, July 1995