Table of Contents

OIL2 Class Standard.HTTPcommonLogFormat

class Standard . HTTPcommonLogFormat {
        set     extraFields;
        oid     fileObj;
        string  fileSpec;
        set     serviceNames;
        oid     serviceOID;
inherits from Object;


The HTTPcommonLogFormat class implements a logging service for the HTTPdaemon that records access activity. It registers itself as the service named HTTPlogger:websiteName; it defaults to HTTPlogger:localhost.

A more sophisticated (and, unfortunately, computationally complex) facility is provide by HTTPextendedLogFormat.



HTTPcommonLogFormat:create(string fileName, optional string servName)

Method Description

See initialize.


HTTPcommonLogFormat:initialize(string fileName, optional string servName)

Method Description

The initialize method usually takes two arguments:

The output is in the common log format:

Note: undefined values are written as "-".

If additional arguments are provided, they are treated as string keys that select HTTP header options. For each such key, a corresponding additional field will be appended to every log line. The most popular such field is "referer", which provides an indication of what page referenced the object in question.


HTTPcommonLogFormat:reopen(optional string newFileName)

Method Description

The reopen method requests that the current log file be closed and then reopened. This is typically invoked by a remote application during log file rotation: the current log file is renamed, then a reopen request is invoked, which causes the current log file to be closed and a new one to be created. If the optional argument newFileName is provided, it is set as the name of the new log file. If newFileName is specified as the null string or "-", then a new log file is not opened.

Return Value

If fromObject is not nil, then a value indicating the success of the request is returned. A value of 0 indicates that the request was performed; a value of -1 indicates that a reopen was attempted but no log file was active and no new file name was provided.


HTTPcommonLogFormat:logRequest(string fromAddr, int32 localTime, array header, assoc options, int32 statusCode, int32 bytesSent, string reasonPhrase)

Method Description

Objects of HTTPfastReceive send logRequest messages to the logging service associated with their corresponding web site (which is represented by a URLdirectory object).

Return Value

This method returns no value.