Package org.apache.catalina
Interface AccessLog
-
- All Known Implementing Classes:
AbstractAccessLogValve,AccessLogAdapter,AccessLogValve,ExtendedAccessLogValve,JDBCAccessLogValve,StandardEngine.NoopAccessLog
public interface AccessLogIntended for use by aValveto indicate that theValveprovides 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 providedRequestandResponseobjects 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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROTOCOL_ATTRIBUTEName of request attribute used to override the protocol recorded by the AccessLog.static StringREMOTE_ADDR_ATTRIBUTEName of request attribute used to override the remote address recorded by the AccessLog.static StringREMOTE_HOST_ATTRIBUTEName of request attribute used to override remote host name recorded by the AccessLog.static StringSERVER_NAME_ATTRIBUTEName of request attribute used to override the server name recorded by the AccessLog.static StringSERVER_PORT_ATTRIBUTEName of request attribute used to override the server port recorded by the AccessLog.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleangetRequestAttributesEnabled()voidlog(Request request, Response response, long time)Add the request/response to the access log using the specified processing time.voidsetRequestAttributesEnabled(boolean requestAttributesEnabled)Should this valve use request attributes for IP address, hostname, protocol and port used for the request?
-
-
-
Field Detail
-
REMOTE_ADDR_ATTRIBUTE
static final String REMOTE_ADDR_ATTRIBUTE
Name of request attribute used to override the remote address recorded by the AccessLog.- See Also:
- Constant Field Values
-
REMOTE_HOST_ATTRIBUTE
static final String REMOTE_HOST_ATTRIBUTE
Name of request attribute used to override remote host name recorded by the AccessLog.- See Also:
- Constant Field Values
-
PROTOCOL_ATTRIBUTE
static final String PROTOCOL_ATTRIBUTE
Name of request attribute used to override the protocol recorded by the AccessLog.- See Also:
- Constant Field Values
-
SERVER_NAME_ATTRIBUTE
static final String SERVER_NAME_ATTRIBUTE
Name of request attribute used to override the server name recorded by the AccessLog.- See Also:
- Constant Field Values
-
SERVER_PORT_ATTRIBUTE
static final String SERVER_PORT_ATTRIBUTE
Name of request attribute used to override the server port recorded by the AccessLog.- See Also:
- Constant Field Values
-
-
Method Detail
-
log
void log(Request request, Response response, long time)
Add the request/response to the access log using the specified processing time.- Parameters:
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)
-
setRequestAttributesEnabled
void setRequestAttributesEnabled(boolean requestAttributesEnabled)
Should this valve use request attributes for IP address, hostname, protocol and port used for the request? The attributes used are:- org.apache.catalina.RemoteAddr
- org.apache.catalina.RemoteHost
- org.apache.catalina.Protocol
- org.apache.catalina.ServerName
- org.apache.catalina.ServerPost
- Parameters:
requestAttributesEnabled-truecauses the attributes to be used,falsecauses the original values to be used.
-
getRequestAttributesEnabled
boolean getRequestAttributesEnabled()
- Returns:
trueif the attributes will be logged, otherwisefalse- See Also:
setRequestAttributesEnabled(boolean)
-
-