|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SK.gnome.dwarf.GenericService SK.gnome.dwarf.http.log.HTTPLogFormat SK.gnome.dwarf.http.log.DwarfLogFormat
Dwarf Log Format.
This is a properietary log format with the following record structure:
date time remote-addr host remote-user method uri protocol status bytes elapsed referer user-agent
This format is very similar to the ExtendedLogFormat
, except that this class
allows to specify a custom date/time format based on the given locale information and the elapsed
time information is in integer number of milliseconds instead of the floating number of seconds.
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 | |
DwarfLogFormat(java.lang.String name)
Creates a new DwarfLogFormat. |
Method Summary | |
java.lang.String |
format(long time,
Request request,
Response response)
Formats the HTTP transfer log message. |
void |
setDateTimeFormat(java.lang.String format)
Sets the date/time format. |
void |
setDateTimeFormat(java.lang.String format,
java.lang.String language,
java.lang.String country)
Sets the date/time format with the given locale. |
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, init, 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 |
public DwarfLogFormat(java.lang.String name)
Method Detail |
public void setDateTimeFormat(java.lang.String format)
The format will be based on the US locale.
format
- the date/time formatpublic void setDateTimeFormat(java.lang.String format, java.lang.String language, java.lang.String country)
The format will be based on a locale created from the given language and country arguments.
format
- the date/time formatlanguage
- the languagecountry
- the countrypublic java.lang.String format(long time, Request request, Response response)
HTTPLogFormat
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.
format
in class HTTPLogFormat
time
- the current timerequest
- the finished requestresponse
- the finished response
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |