Table of Contents

OIL2 Class Standard.HTTPextendedLogFormat

class Standard . HTTPextendedLogFormat {
        set     fieldNames;
        oid     fileObj;
        string  fileSpec;
        int32   outputHeader;
        string  serviceName;
        oid     serviceOID;
inherits from Object;


The HTTPextendedLogFormat 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. See reference:

A slightly simplified logging interface is provided by the class HTTPcommonLogFormat.



HTTPextendedLogFormat:create(string fileName, string servName)

Method Description

See initialize.


HTTPextendedLogFormat:initialize(string fileName, string servName)

Method Description

The initialize method usually takes at least 3 arguments. The first is a fileName to which access log records should be appended. If specified as the null string or "-", no log file is opened. The second argument specifies the name of the web server (corrresponding to the ServerName parameter in the profile read by HTTPdaemon) to which this logging object should be associated. To construct the name of the logging service, the value provided is appended to the prefix "HTTPlogger:".

The third and any remaining arguments identify the names of fields to be written to the each line of the log file. Any undefined values will be written as "-".

The naming conventions are defined in the Extended Log File specification referenced above. The list of current recognized attributes is provided below.

an implementation-specific extension that outputs the date/time in the old format used by the common log format.
an implementation-specific extension that outputs the user info obtained from ident.
an implementation-specific extension that outputs the user identity.
the request date in YYYY-MM-DD format.
the request date in HH:MM:SS.
the elapsed time of the request in seconds.
the number of the bytes request.
a Boolean indication if the data was cached.
the HTTP status code returned to the client (e.g., 200, 404, etc.)
a textual description of the status code (e.g., OK, Not Found, etc.)
the IP address of the client
the resolved hostname of the client (not yet implemented)
the method used to make the query (e.g., GET, PUT, POST, etc.)
the complete URI requested.
an implementation-specific extension that indicates the protocol used by the client (typically, HTTP/1.0 or HTTP/1.1).
the base part of the requested URI.
the query portion of the URI.
outputs the value of the corresponding HTTP header provided in the client's request. For example, cs(referer) outputs the "Referer:" field.


HTTPextendedLogFormat: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.


HTTPextendedLogFormat:logFileOpened(oid fileObject)

Method Description

The logFileOpened method is called each time a log file is opened. Subclasses can override this default implementation to extend or inhibit the implementation provided here.

The extended log format specification requires that a log file begin with two lines that the specify the version and fields provided in the log. The logFileOpened method writes this required data to the log file each time it is opened.


HTTPextendedLogFormat:logFileClosed(oid fileObject)

Method Description

The logFileClosed method is called each time a log file is closed. Subclasses can override this default implementation to extend or inhibit the implementation provided here.

The logFileClosed method writes an "End-Date" directive to the log file each time it is closed.


HTTPextendedLogFormat: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.