|
||||||||||
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
This class provides a generic format of the HTTP transfer logs.
Subclasses must override the abstract format(long, Request, Response)
method
to implement a real log format.
A HTTPLogFormat instance can be added either to the Host
or the Application
object to setup the desired format of the HTTP
log messages.
Field Summary | |
protected boolean |
host
Whether or not to log the "Host" request header. |
protected boolean |
protocol
Whether or not to log the request protocol. |
protected boolean |
referer
Whether or not to log the "Referer" request header. |
protected boolean |
userAgent
Whether or not to log the "User-Agent" request header. |
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 | |
HTTPLogFormat(java.lang.String name)
Creates a new HTTPLogFormat. |
Method Summary | |
abstract java.lang.String |
format(long time,
Request request,
Response response)
Formats the HTTP transfer log message. |
void |
setHost(boolean enable)
Enables or dissable logging of the "Host" request header. |
void |
setProtocol(boolean enable)
Enables or dissable logging of the request protocol. |
void |
setReferer(boolean enable)
Enables or dissable logging of the "Referer" request header. |
void |
setUserAgent(boolean enable)
Enables or dissable logging of the "User-Agent" request header. |
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 |
Field Detail |
protected boolean host
Default value: true
setHost(boolean)
protected boolean protocol
Default value: true
setProtocol(boolean)
protected boolean referer
Default value: false
setReferer(boolean)
protected boolean userAgent
Default value: false
setUserAgent(boolean)
Constructor Detail |
public HTTPLogFormat(java.lang.String name)
Method Detail |
public void setHost(boolean enable)
enable
- true to enable logginghost
public void setProtocol(boolean enable)
enable
- true to enable loggingprotocol
public void setReferer(boolean enable)
enable
- true to enable loggingreferer
public void setUserAgent(boolean enable)
enable
- true to enable logginguserAgent
public abstract java.lang.String format(long time, Request request, Response response)
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.
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 |