Top Description Inners Fields Constructors Methods
org.apache.catalina.valves

public Class ExtendedAccessLogValve

extends AccessLogValve
Class Inheritance
Imports
java.io.CharArrayWriter, .IOException, .StringReader, java.net.InetAddress, java.nio.charset.StandardCharsets, java.text.SimpleDateFormat, java.util.ArrayList, .Date, .Iterator, .List, .Locale, .TimeZone, jakarta.servlet.http.Cookie, .HttpSession, org.apache.catalina.connector.Request, .Response, org.apache.catalina.util.ServerInfo, .URLEncoder, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.ExceptionUtils

An implementation of the W3c Extended Log File Format. See http://www.w3.org/TR/WD-logfile.html for more information about the format. The following fields are supported:

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.

Author
Peter Rossbach

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
protected static class
private static class
protected static class
protected static class
protected static class
protected static class
protected static class
ExtendedAccessLogValve.ResponseAllHeaderElement

write a specific response header - x-O(xxx)

protected static class
protected static class
protected static class
protected static class

Field Summary

Modifier and TypeField and Description
private static final Log
Inherited from org.apache.catalina.valves.AccessLogValve:
currentLogFileencodingfileDateFormatfileDateFormatterprefixrenameOnRotaterotatablesuffixwriter

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected AbstractAccessLogValve.AccessLogElement[]
createLogElements()

Overrides org.apache.catalina.valves.AbstractAccessLogValve.createLogElements.

Parse pattern string and create the array of AccessLogElement.

protected AbstractAccessLogValve.AccessLogElement
protected AbstractAccessLogValve.AccessLogElement
protected AbstractAccessLogValve.AccessLogElement
protected AbstractAccessLogValve.AccessLogElement
protected AbstractAccessLogValve.AccessLogElement
protected AbstractAccessLogValve.AccessLogElement
protected synchronized void
open()

Overrides org.apache.catalina.valves.AccessLogValve.open.

Open the new log file for the date specified by dateStamp.

pack-priv static String

Returns:

'-' if null. Otherwise, toString() will be called on the object and the value will be wrapped in quotes and any quotes will be escaped with 2 sets of quotes.
wrap
(Object
- The value to wrap
value
)

Wrap the incoming value with double quotes (") and escape any double quotes appearing in the value using two double quotes ("").

Inherited from org.apache.catalina.valves.AccessLogValve:
backgroundProcessgetDirectorygetEncodinggetFileDateFormatgetMaxDaysgetPrefixgetSuffixisBufferedisCheckExistsisRenameOnRotateisRotatablelogrotaterotatesetBufferedsetCheckExistssetDirectorysetEncodingsetFileDateFormatsetMaxDayssetPrefixsetRenameOnRotatesetRotatablesetSuffixstartInternalstopInternal