|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tomcat.core.BaseInterceptor
org.apache.tomcat.modules.loggers.AccessLogInterceptor
This is a TomCat RequestInterceptor that creates log files
in the style of the Apache servers "AccessLog". It used by
embedding a line like the following into server.xml
:
<RequestInterceptor className="org.apache.tomcat.logging.AccessLogInterceptor" logFile="logs/AccessLog" format="combined"/>
Possible attributes of the above XML element are:
logFile | Name of the logfile being generated. Defaults to "logs/AccessLog". Tomcat.home is prepended, if the file name is relative. | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
flush | An optional boolean attribute, that enables (value = "true") or disables (value="false", default) flushing the log file after every request. For performance reasons, you should not enable flushing unless you are debugging this class. | |||||||||||||||||||||
format |
A string describing the logfile format. Possible values are
"combined" (Apache httpd combined format, default), "common"
(Apache httpd common format) or a format string like
'%h %l %u %t "%r" %>s %b "%{Referer}" "%{User-Agent}"' '%h %l %u %t "%r" %>s %b'(The above examples are used when "combined" or "common" format is requested.) Possible patterns are:
|
Field Summary |
Fields inherited from class org.apache.tomcat.core.BaseInterceptor |
cm, ct, ctx, debug, DECLINED, loghelper, OK |
Constructor Summary | |
AccessLogInterceptor()
Creates a new AccessLogInterceptor |
Method Summary | |
int |
beforeCommit(Request request,
Response response)
This method is actually creating an entry in the log file. |
void |
engineShutdown(ContextManager cm)
Shut down the module. |
static void |
setFlush(boolean flush)
Enables (true) or disables (false, default) flushing the log file after any request. |
static void |
setFormat(java.lang.String format)
Sets the logfile format. |
static void |
setLogFile(java.lang.String logFile)
Sets the logfile name. |
Methods inherited from class org.apache.tomcat.core.BaseInterceptor |
addContainer, addContext, addHandler, addInterceptor, addSecurityConstraint, afterBody, authenticate, authorize, beforeBody, contextInit, contextMap, contextShutdown, contextState, engineInit, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AccessLogInterceptor()
Method Detail |
public static void setLogFile(java.lang.String logFile)
Sets the logfile name.
public static void setFlush(boolean flush)
Enables (true) or disables (false, default) flushing the log file after any request.
public static void setFormat(java.lang.String format)
Sets the logfile format.
public int beforeCommit(Request request, Response response)
This method is actually creating an entry in the log file.
beforeCommit
in class BaseInterceptor
public void engineShutdown(ContextManager cm) throws TomcatException
BaseInterceptor
engineShutdown
in class BaseInterceptor
TomcatException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |