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 mod_log_config
module. As an additional feature, automatic rollover of log files when the date changes is also supported.
Patterns for the logged message may include constant text or any of the following replacement strings, for which the corresponding information from the specified Response is substituted:
In addition, the caller can specify one of the following aliases for commonly utilized patterns:
%h %l %u %t "%r" %s %b
%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"
There is also support to write information from the cookie, incoming header, the Session or something else in the ServletRequest.
It is modeled after the apache syntax:
%{xxx}i
for incoming headers %{xxx}o
for outgoing response headers %{xxx}c
for a specific cookie %{xxx}r
xxx is an attribute in the ServletRequest %{xxx}s
xxx is an attribute in the HttpSession 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.
|
|