SK.gnome.dwarf.http.log
Class ExtendedLogFormat

java.lang.Object
  extended bySK.gnome.dwarf.GenericService
      extended bySK.gnome.dwarf.http.log.HTTPLogFormat
          extended bySK.gnome.dwarf.http.log.ExtendedLogFormat
All Implemented Interfaces:
SK.gnome.dwarf.Service

public class ExtendedLogFormat
extends HTTPLogFormat

W3C Extended Log Format.

The log format is described by the following string:

 #Fields: date time c-ip cs(Host) cs-user cs-method cs-uri cs-protocol sc-status bytes time-taken cs(Referer) cs(User-Agent)
 

Logging of the "Host" header, the HTTP protocol, the "Referer" header and "User-Agent" header can be controlled via the corresponding setter methods, inherited from the superclass.

Logging of the "Host" request header may be useful for distinguishing requests to various virtual servers if they are logged to a single central file. This feature is enabled by default.


Field Summary
 
Fields inherited from class SK.gnome.dwarf.http.log.HTTPLogFormat
host, protocol, referer, userAgent
 
Fields inherited from class SK.gnome.dwarf.GenericService
initParameters, parent
 
Fields inherited from interface SK.gnome.dwarf.Service
INITIALIZED, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, LOG_XFER, SHUTDOWN, STARTED, STOPPED
 
Constructor Summary
ExtendedLogFormat(java.lang.String name)
          Creates a new ExtendedLogFormat.
 
Method Summary
 java.lang.String format(long time, Request request, Response response)
          Formats the HTTP transfer log message.
 void init(SK.gnome.dwarf.Server parent)
           
 
Methods inherited from class SK.gnome.dwarf.http.log.HTTPLogFormat
setHost, setProtocol, setReferer, setUserAgent
 
Methods inherited from class SK.gnome.dwarf.GenericService
getAuthenticator, getAuthFacility, getFullName, getInitParameter, getInitParameterNames, getLogFacility, getLogger, getName, getParameters, getPrincipal, getShutdownTimeout, getState, log, log, login, logout, setAuthFacility, setInitParameters, setLogFacility, shutdown, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtendedLogFormat

public ExtendedLogFormat(java.lang.String name)
Creates a new ExtendedLogFormat.

Method Detail

init

public void init(SK.gnome.dwarf.Server parent)
          throws SK.gnome.dwarf.ServiceException
Throws:
SK.gnome.dwarf.ServiceException

format

public java.lang.String format(long time,
                               Request request,
                               Response response)
Description copied from class: HTTPLogFormat
Formats the HTTP transfer log message.

This method must be overriden in order to implement a custom log format. It should read the HTTP-related information from the given request and response objects and create the log message according to them.

The log message returned by this method should include also the date and time information according to the given time argument.

Specified by:
format in class HTTPLogFormat
Parameters:
time - the current time
request - the finished request
response - the finished response
Returns:
the log message


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.