public interface AccessLog
Valve
to indicate that the Valve
provides access logging. It is used by the Tomcat internals to identify a
Valve that logs access requests so requests that are rejected
earlier in the processing chain can still be added to the access log.
Implementations of this interface should be robust against the provided
Request
and Response
objects being null, having null
attributes or any other 'oddness' that may result from attempting to log
a request that was almost certainly rejected because it was mal-formed.Modifier and Type | Field and Description |
---|---|
static String |
PROTOCOL_ATTRIBUTE
Name of request attribute used to override the protocol recorded by the
AccessLog.
|
static String |
REMOTE_ADDR_ATTRIBUTE
Name of request attribute used to override the remote address recorded by
the AccessLog.
|
static String |
REMOTE_HOST_ATTRIBUTE
Name of request attribute used to override remote host name recorded by
the AccessLog.
|
static String |
SERVER_PORT_ATTRIBUTE
Name of request attribute used to override the server port recorded by
the AccessLog.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getRequestAttributesEnabled() |
void |
log(Request request,
Response response,
long time)
Add the request/response to the access log using the specified processing
time.
|
void |
setRequestAttributesEnabled(boolean requestAttributesEnabled)
Should this valve set request attributes for IP address, Hostname,
protocol and port used for the request?
|
static final String REMOTE_ADDR_ATTRIBUTE
static final String REMOTE_HOST_ATTRIBUTE
static final String PROTOCOL_ATTRIBUTE
static final String SERVER_PORT_ATTRIBUTE
void log(Request request, Response response, long time)
request
- Request (associated with the response) to logresponse
- Response (associated with the request) to logtime
- Time taken to process the request/response in
milliseconds (use 0 if not known)void setRequestAttributesEnabled(boolean requestAttributesEnabled)
AccessLogValve
which will otherwise log the original values.
Default is true
.
The attributes set are:
requestAttributesEnabled
- true
causes the attributes
to be set, false
disables
the setting of the attributes.boolean getRequestAttributesEnabled()
true
if the attributes will be logged, otherwise
false
setRequestAttributesEnabled(boolean)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.