httpd::log - Logging of web activity
The package httpd::log is a core module providing all other modules of the web server with commands to log user activity.
This package has a soft-dependency on the package httpd::counter. The command Log_SetFile will use Counter_Checkpoint to save the counter state as part of flushing the logs to disk, but only if the httpd::counter package is present.
Log information about the activity of the web server. There are two kinds of log entries. One normal entry that goes into its own log, one line for each HTTP transaction. All other log records are appended to an error log file.
The first argument, sock provides the handle of the connection causing the generation of this entry. If the reason is set to Close then this is the normal completion of a request. Otherwise, this is some error tag and the record goes to the error log.
The other arguments are copied verbatim into the log file chosen for the entry.
(Re)configures the package, or retrieves the configuration.
When called without arguments the current configuration is returned as a dictionary. When called with a single argument the current value of that option is returned. Else the package is reconfigured using the specificed options and values.
The accepted options are
Sets the interval in minutes at which the logs are flushed to disk. If the interval is set to 0 then the logs will be flushed on each write. The default is one minute.
The command is multi-purpose. Calling it sets a new basename for the two log files. It flushes all logs, rotates the old log files and swaps in the new. It also sets up a timer event which will perform the same rotation at the next midnight.
When called without argument it performs all of the operations above, except that the basename for the log files is not changed. This is the way the timer event above is set up.
The above means that this command should be used once, during the startup of the web server to define a log file and initiate the logging. From then on the system will automatically rotate the created logs every midnight without user intervention.
Calling this command causes the package to periodically flush the log files to disk, according to the interval set via Log_FlushMinutes.
httpd, httpd::counter, httpd::logstd
log, trace, web server
Copyright © 2003 Andreas Kupries <[email protected]>