From: kkolinko Implementation of the Valve interface that generates a web server
* access log with the detailed line contents matching a configurable pattern.
* The syntax of the available patterns is similar to that supported by the
- * Apache Patterns for the logged message may include constant text or any of the
@@ -101,7 +102,9 @@ import org.apache.tomcat.util.buf.B2CConverter;
*
* There is also support to write information from the cookie, incoming
* header, the Session or something else in the ServletRequest.mod_log_config module. As an additional feature,
+ * Apache HTTP Server
+ * mod_log_config module. As an additional feature,
* automatic rollover of log files when the date changes is also supported.
- * It is modeled after the apache syntax:
+ * It is modeled after the
+ * Apache HTTP Server log configuration
+ * syntax:
*
*
%{xxx}i for incoming headers
* %{xxx}o for outgoing response headers
@@ -112,10 +115,34 @@ import org.apache.tomcat.util.buf.B2CConverter;
*
+ * Log rotation can be on or off. This is dictated by the rotatable + * property. + *
+ * + *
+ * For UvNIX 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.
+ * 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 Craig R. McClanahan diff --git a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java index 53a33fd3e..5d30bdb9e 100644 --- a/java/org/apache/catalina/valves/ExtendedAccessLogValve.java +++ b/java/org/apache/catalina/valves/ExtendedAccessLogValve.java @@ -74,14 +74,14 @@ import org.apache.tomcat.util.ExceptionUtils; * 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): getGequestedSessionIdx-H(requestedSessionId): getRequestedSessionIdx-H(requestedSessionIdFromCookie):
* isRequestedSessionIdFromCookie x-H(requestedSessionIdValid):
@@ -98,7 +98,7 @@ import org.apache.tomcat.util.ExceptionUtils;
*
*
*
- * For UvNIX users, another field called checkExistsis also
+ * For UvNIX 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.
@@ -107,14 +107,14 @@ import org.apache.tomcat.util.ExceptionUtils;
*
* 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 start writing a new log file. + * 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.
+ * yields a non-null value, the logging will be skipped.
*
diff --git a/webapps/docs/config/valve.xml b/webapps/docs/config/valve.xml
index 0c55d8fce..4846782a6 100644
--- a/webapps/docs/config/valve.xml
+++ b/webapps/docs/config/valve.xml
@@ -133,12 +133,11 @@
The prefix added to the start of each log file's name. If not
- specified, the default value is "access_log.". To specify no prefix,
- use a zero-length string.
Set to true to check for the existance of request
+
Set to The suffix added to the end of each log file's name. If not
- specified, the default value is "". To specify no suffix,
- use a zero-length string.true to check for the existence of request
attributes (typically set by the RemoteIpValve and similar) that should
be used to override the values returned by the request for remote
address, remote host, server port and protocol. If the attributes are
@@ -154,8 +153,8 @@
%{xxx}i for incoming headers%{xxx}o for outgoing response headersThe prefix added to the start of each log file's name. If not - specified, the default value is "access_log.". To specify no prefix, - use a zero-length string.
+ specified, the default value is "access_log.".Set to true to check for the existance of request
+
Set to The suffix added to the end of each log file's name. If not
- specified, the default value is "". To specify no suffix,
- use a zero-length string.true to check for the existence of request
attributes (typically set by the RemoteIpValve and similar) that should
be used to override the values returned by the request for remote
address, remote host, server port and protocol. If the attributes are
@@ -345,8 +345,8 @@
For any of the x-H(XXX) the following method will be called from the
- HttpServletRequestObject:
x-H(authType): getAuthType x-H(characterEncoding): getCharacterEncoding x-H(locale): getLocalex-H(protocol): getProtocol x-H(remoteUser): getRemoteUserx-H(requestedSessionId): getGequestedSessionIdx-H(requestedSessionId): getRequestedSessionIdx-H(requestedSessionIdFromCookie):
isRequestedSessionIdFromCookie x-H(requestedSessionIdValid):