| java.lang.Object sunlabs.brazil.handler.LogHandler
LogHandler | public class LogHandler implements Handler(Code) | | Handler for logging information about requests.
Wraps another handler, and logs information
about each HTTP request to a file.
Request properties:
- handler
- The name of the handler to wrap. This can either be the token
for the class, or the class name itself.
- fileName
- The name of the file to log the output to. If the file already exists,
data is appended to it. If the file is removed, a new one is created.
- format
- The format of the output string. Embedded stings of the form "%X"
are replaced, based on the following values for "X":
- %
A single "%"
- b
Bytes written to the client for this request.
- d
Time to service this request (ms).
- i
Client ip address.
- m
Request method (GET, POST, etc)
- M
Memory utilization (%).
- q
query string (if any)
- r
Requests used for this connection.
- s
HTTP result code.
- t
TimeStamp (ms since epoch).
- T
Number of active threads.
- u
URL for this request.
- v
HTTP protocol version (10 or 11).
Defaults to "%u;%t:%d:%b".
- props
- If specified This string is tacked onto the end of the "format"
string. Entries in the Request Properties may be included using
${...} substitutions.
- headers
- If specified This string is tacked onto the end of the "props"
string. Entries in the HTTPrequest headers may be included using
${...} substitutions.
- title
- if present, this is output as the first line of the file
See the
ChainSawHandler for generating standard format
log files.
author: Stephen Uhler version: 1.16, 00/10/31 |
format | static boolean format(Request request, char c, StringBuffer buff, long duration)(Code) | | Compute built-in strings by mapping %n's to values
|
respond | public boolean respond(Request request) throws IOException(Code) | | Dispatch the request to the handler. Log information if
dispatched handler returns true.
|
|
|