public class ExtendedAccessLogValve extends AccessLogValve
c-dns
: Client hostname (or ip address if
enableLookups
for the connector is false)c-ip
: Client ip addressbytes
: bytes servedcs-method
: request methodcs-uri
: The full uri requestedcs-uri-query
: The query stringcs-uri-stem
: The uri without query stringdate
: The date in yyyy-mm-dd format for GMTs-dns
: The server dns entry s-ip
: The server ip addresscs(XXX)
: The value of header XXX from client to serversc(XXX)
: The value of header XXX from server to client sc-status
: The status codetime
: Time the request was servedtime-taken
: Time (in seconds) taken to serve the requestx-threadname
: Current request thread name (can compare later with stacktraces)x-A(XXX)
: Pull XXX attribute from the servlet context x-C(XXX)
: Pull the first cookie of the name XXX x-O(XXX)
: Pull the all response header values XXX x-R(XXX)
: Pull XXX attribute from the servlet request x-S(XXX)
: Pull XXX attribute from the session x-P(...)
: Call request.getParameter(...)
and URLencode it. Helpful to capture
certain POST parameters.
x-H(authType)
: getAuthType x-H(characterEncoding)
: getCharacterEncoding x-H(contentLength)
: getContentLength x-H(locale)
: getLocalex-H(protocol)
: getProtocol x-H(remoteUser)
: getRemoteUserx-H(requestedSessionId)
: getRequestedSessionIdx-H(requestedSessionIdFromCookie)
:
isRequestedSessionIdFromCookie x-H(requestedSessionIdValid)
:
isRequestedSessionIdValidx-H(scheme)
: getSchemex-H(secure)
: isSecure
Log rotation can be on or off. This is dictated by the
rotatable
property.
For UNIX users, another field called checkExists
is also
available. If set to true, the log file's existence will be checked before
each logging. This way an external log rotator can move the file
somewhere and Tomcat will start with a new file.
For JMX junkies, a public method called rotate
has
been made available to allow you to tell this instance to move
the existing log file to somewhere else and start writing a new log file.
Conditional logging is also supported. This can be done with the
condition
property.
If the value returned from ServletRequest.getAttribute(condition)
yields a non-null value, the logging will be skipped.
For extended attributes coming from a getAttribute() call, it is you responsibility to ensure there are no newline or control characters.
Modifier and Type | Class and Description |
---|---|
protected static class |
ExtendedAccessLogValve.CookieElement |
protected static class |
ExtendedAccessLogValve.DateElement |
protected static class |
ExtendedAccessLogValve.PatternTokenizer |
protected static class |
ExtendedAccessLogValve.RequestAttributeElement |
protected static class |
ExtendedAccessLogValve.RequestHeaderElement |
protected static class |
ExtendedAccessLogValve.RequestParameterElement |
protected static class |
ExtendedAccessLogValve.ResponseAllHeaderElement
write a specific response header - x-O(xxx)
|
protected static class |
ExtendedAccessLogValve.ResponseHeaderElement |
protected static class |
ExtendedAccessLogValve.ServletContextElement |
protected static class |
ExtendedAccessLogValve.SessionAttributeElement |
protected static class |
ExtendedAccessLogValve.TimeElement |
AccessLogValve.AccessLogElement, AccessLogValve.ByteSentElement, AccessLogValve.DateAndTimeElement, AccessLogValve.DateFormatCache, AccessLogValve.ElapsedTimeElement, AccessLogValve.FirstByteTimeElement, AccessLogValve.HeaderElement, AccessLogValve.HostElement, AccessLogValve.HttpStatusCodeElement, AccessLogValve.LocalAddrElement, AccessLogValve.LocalServerNameElement, AccessLogValve.LogicalUserNameElement, AccessLogValve.MethodElement, AccessLogValve.PortElement, AccessLogValve.ProtocolElement, AccessLogValve.QueryElement, AccessLogValve.RemoteAddrElement, AccessLogValve.RequestElement, AccessLogValve.RequestURIElement, AccessLogValve.SessionIdElement, AccessLogValve.StringElement, AccessLogValve.ThreadNameElement, AccessLogValve.UserElement
Lifecycle.SingleUse
Modifier and Type | Field and Description |
---|---|
protected static String |
extendedAccessLogInfo
The descriptive information about this implementation.
|
condition, conditionIf, currentLogFile, enabled, encoding, fileDateFormat, fileDateFormatter, info, locale, localeName, logElements, pattern, prefix, renameOnRotate, requestAttributesEnabled, rotatable, suffix, writer
asyncSupported, container, containerLog, next, sm
mserver
PROTOCOL_ATTRIBUTE, REMOTE_ADDR_ATTRIBUTE, REMOTE_HOST_ATTRIBUTE, SERVER_NAME_ATTRIBUTE, SERVER_PORT_ATTRIBUTE
AFTER_DESTROY_EVENT, AFTER_INIT_EVENT, AFTER_START_EVENT, AFTER_STOP_EVENT, BEFORE_DESTROY_EVENT, BEFORE_INIT_EVENT, BEFORE_START_EVENT, BEFORE_STOP_EVENT, CONFIGURE_START_EVENT, CONFIGURE_STOP_EVENT, PERIODIC_EVENT, START_EVENT, STOP_EVENT
Constructor and Description |
---|
ExtendedAccessLogValve() |
Modifier and Type | Method and Description |
---|---|
protected AccessLogValve.AccessLogElement[] |
createLogElements()
parse pattern string and create the array of AccessLogElement
|
protected AccessLogValve.AccessLogElement |
getClientToServerElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) |
String |
getInfo()
Return descriptive information about this implementation.
|
protected AccessLogValve.AccessLogElement |
getLogElement(String token,
ExtendedAccessLogValve.PatternTokenizer tokenizer) |
protected AccessLogValve.AccessLogElement |
getProxyElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) |
protected AccessLogValve.AccessLogElement |
getServerToClientElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) |
protected AccessLogValve.AccessLogElement |
getServletRequestElement(String parameter) |
protected AccessLogValve.AccessLogElement |
getXParameterElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) |
protected void |
open()
Open the new log file for the date specified by
dateStamp . |
backgroundProcess, createAccessLogElement, createAccessLogElement, findLocale, getCondition, getConditionIf, getConditionUnless, getDirectory, getEnabled, getEncoding, getFileDateFormat, getLocale, getMaxDays, getPattern, getPrefix, getRequestAttributesEnabled, getSuffix, invoke, isBuffered, isCheckExists, isRenameOnRotate, isResolveHosts, isRotatable, log, log, rotate, rotate, setBuffered, setCheckExists, setCondition, setConditionIf, setConditionUnless, setDirectory, setEnabled, setEncoding, setFileDateFormat, setLocale, setMaxDays, setPattern, setPrefix, setRenameOnRotate, setRequestAttributesEnabled, setResolveHosts, setRotatable, setSuffix, startInternal, stopInternal
event, getContainer, getDomainInternal, getNext, getObjectNameKeyProperties, initInternal, isAsyncSupported, setAsyncSupported, setContainer, setNext, toString
destroyInternal, getDomain, getObjectName, postDeregister, postRegister, preDeregister, preRegister, register, setDomain, unregister
addLifecycleListener, destroy, findLifecycleListeners, fireLifecycleEvent, getState, getStateName, getThrowOnFailure, init, removeLifecycleListener, setState, setState, setThrowOnFailure, start, stop
protected static final String extendedAccessLogInfo
public String getInfo()
getInfo
in interface Valve
getInfo
in class AccessLogValve
protected void open()
dateStamp
.open
in class AccessLogValve
protected AccessLogValve.AccessLogElement[] createLogElements()
AccessLogValve
createLogElements
in class AccessLogValve
protected AccessLogValve.AccessLogElement getLogElement(String token, ExtendedAccessLogValve.PatternTokenizer tokenizer) throws IOException
IOException
protected AccessLogValve.AccessLogElement getClientToServerElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) throws IOException
IOException
protected AccessLogValve.AccessLogElement getServerToClientElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) throws IOException
IOException
protected AccessLogValve.AccessLogElement getProxyElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) throws IOException
IOException
protected AccessLogValve.AccessLogElement getXParameterElement(ExtendedAccessLogValve.PatternTokenizer tokenizer) throws IOException
IOException
protected AccessLogValve.AccessLogElement getServletRequestElement(String parameter)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.