nslog

## nslog -- Access logging module

$Header: /cvsroot/aolserver/aolserver/nslog/nslog.html,v 1.2 2004/09/08 18:32:26 dossy Exp $

- Theory of Operation
- Known Issues
- Configuration Options
- Sample Configuration

### Theory of Operation

The nslog module implements Common Log Format access logging. This format can be used by any web analyzer tool. It optionally supports NCSA Combined Log Format, as well as automati log file rolling. The log files are stored in the server/server1/modules/nslog directory by default.

See the following page for detailed information about the Common Log Format.

### Known Issues

None at this time.

### Configuration Options

The following options are available for configuring the nslog module:

Option | Type | Default | Description
--- | --- | --- | ---
extendedheaders | string | N/A | A comma-delimited list of HTTP request headers to log at the end of the logfile entry. This can be useful for logging headers sent by a custom HTTP client.
file | string | access.log | The name of the access log file. It can either be specified as an absolute path including filename, or if specified as a relative pathname, will be relative to the servers/${servername}/modules/nslog directory.
formattedTime | boolean | true | Whether or not the time column in the logfile entry should be formatted as the human-readable "[day/month/year:hour:minute:second zone]" format or as "[seconds]", the number of seconds since Jan 1 1970 00:00:00 UTC, also known as "unix time".
logcombined | boolean | true | Log in NSCA Combined Log Format. Basically, this additionally logs the HTTP "Referer" and "User-Agent" headers.
logreqtime | boolean | false | Compute the number of seconds and microseconds to service the request, expressed as "sec.usec".
maxbuffer | integer | 0 | The number of logfile entries to queue in memory before flushing them to disk. The default of "0" means no buffering will occur.
maxbackup | integer | 100 | Number of backup logfiles to keep when rolling log files.
rollfmt | string | N/A | The format string to append to the logfile name when rolling the file. If not specified, a three-digit integer is used, left-padded with zeroes. The format string is passed to the `strftime()` function, so should contain appropriate formatting sequences, e.g. `"%Y-%m-%d-%H-%M-%S-%Z"`.
rollhour | integer | 0 | This specifies what hour to schedule the logfile roll. Valid values are 0-23.
rolllog | boolean | true | Whether or not the server will automatically roll the log at the specified rollhour.
rollonsignal | boolean | false/A | Whether or not the server will roll the log file when it receives a SIGHUP signal.
suppressquery | boolean | false | Normally, the entire HTTP request URL is logged. If this option is turned on, the optional "query" portion of the URL (that which follows the "?" in the URL) is removed and not logged. This may be important to enable if sensitive or user-identifying information is placed in the URL as a query parameter and must not be logged in order to comply with privacy policies, etc.

### Sample Configuration

    #
    # Access log -- nslog
    #
    ns_section "ns/server/${servername}/module/nslog"
    ns_param   file            "access.log"
    ns_param   formattedtime   true      ;# true=common log format
    ns_param   logcombined     false     ;# true==NCSA combined format
    ns_param   maxbackup       5         ;# Max number to keep around when rolling
    ns_param   rollhour        0         ;# Time to roll log
    ns_param   rolllog         true      ;# Should we roll log?
    ns_param   rollonsignal    true      ;# Roll log on SIGHUP