Package ch.qos.logback.access.spi
Class AccessEvent
java.lang.Object
ch.qos.logback.access.spi.AccessEvent
- All Implemented Interfaces:
IAccessEvent
,DeferredProcessingAware
,Serializable
The Access module's internal representation of logging events. When the
logging component instance is called in the container to log then a
AccessEvent
instance is created. This instance is passed around
to the different logback components.- Author:
- Ceki Gülcü, Sébastien Pennec
- See Also:
-
Field Summary
Fields inherited from interface ch.qos.logback.access.spi.IAccessEvent
NA, SENTINEL
-
Constructor Summary
ConstructorDescriptionAccessEvent
(Context context, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, ServerAdapter adapter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
getAttribute
(String key) long
long
The number of seconds elapsed between receiving the request and logging it.long
The time elapsed between receiving the request and logging it in milliseconds.int
javax.servlet.http.HttpServletRequest
Returns the underlying HttpServletRequest.getRequestHeader
(String key) String[]
The first line of the request.javax.servlet.http.HttpServletResponse
Returns the underlying HttpServletResponse.getResponseHeader
(String key) long
The sequence number associated with this event.int
long
The number of milliseconds elapsed from 1/1/1970 until logging event was created.void
void
setSequenceNumber
(long sequenceNumber) void
setThreadName
(String threadName) void
setTimeStamp
(long timeStamp)
-
Constructor Details
-
AccessEvent
public AccessEvent(Context context, javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, ServerAdapter adapter)
-
-
Method Details
-
getRequest
Returns the underlying HttpServletRequest. After serialization the returned value will be null.- Specified by:
getRequest
in interfaceIAccessEvent
- Returns:
-
getResponse
Returns the underlying HttpServletResponse. After serialization the returned value will be null.- Specified by:
getResponse
in interfaceIAccessEvent
- Returns:
-
getTimeStamp
Description copied from interface:IAccessEvent
The number of milliseconds elapsed from 1/1/1970 until logging event was created.- Specified by:
getTimeStamp
in interfaceIAccessEvent
-
setTimeStamp
-
getSequenceNumber
Description copied from interface:IAccessEvent
The sequence number associated with this event.Sequence numbers, if present, should be increasing monotonically.
- Specified by:
getSequenceNumber
in interfaceIAccessEvent
-
setSequenceNumber
-
setThreadName
- Specified by:
setThreadName
in interfaceIAccessEvent
- Parameters:
threadName
- The threadName to set.
-
getThreadName
- Specified by:
getThreadName
in interfaceIAccessEvent
-
getRequestURI
- Specified by:
getRequestURI
in interfaceIAccessEvent
-
getQueryString
- Specified by:
getQueryString
in interfaceIAccessEvent
-
getRequestURL
The first line of the request.- Specified by:
getRequestURL
in interfaceIAccessEvent
-
getRemoteHost
- Specified by:
getRemoteHost
in interfaceIAccessEvent
-
getRemoteUser
- Specified by:
getRemoteUser
in interfaceIAccessEvent
-
getProtocol
- Specified by:
getProtocol
in interfaceIAccessEvent
-
getMethod
- Specified by:
getMethod
in interfaceIAccessEvent
-
getSessionID
- Specified by:
getSessionID
in interfaceIAccessEvent
-
getServerName
- Specified by:
getServerName
in interfaceIAccessEvent
-
getRemoteAddr
- Specified by:
getRemoteAddr
in interfaceIAccessEvent
-
getRequestHeader
- Specified by:
getRequestHeader
in interfaceIAccessEvent
-
getRequestHeaderNames
- Specified by:
getRequestHeaderNames
in interfaceIAccessEvent
-
getRequestHeaderMap
- Specified by:
getRequestHeaderMap
in interfaceIAccessEvent
-
buildRequestHeaderMap
-
buildRequestParameterMap
-
getRequestParameterMap
- Specified by:
getRequestParameterMap
in interfaceIAccessEvent
-
getAttribute
- Specified by:
getAttribute
in interfaceIAccessEvent
-
getRequestParameter
- Specified by:
getRequestParameter
in interfaceIAccessEvent
-
getCookie
- Specified by:
getCookie
in interfaceIAccessEvent
-
getContentLength
- Specified by:
getContentLength
in interfaceIAccessEvent
-
getStatusCode
- Specified by:
getStatusCode
in interfaceIAccessEvent
-
getElapsedSeconds
Description copied from interface:IAccessEvent
The number of seconds elapsed between receiving the request and logging it.- Specified by:
getElapsedSeconds
in interfaceIAccessEvent
-
getElapsedTime
Description copied from interface:IAccessEvent
The time elapsed between receiving the request and logging it in milliseconds.- Specified by:
getElapsedTime
in interfaceIAccessEvent
-
getRequestContent
- Specified by:
getRequestContent
in interfaceIAccessEvent
-
getResponseContent
- Specified by:
getResponseContent
in interfaceIAccessEvent
-
getLocalPort
- Specified by:
getLocalPort
in interfaceIAccessEvent
-
getServerAdapter
- Specified by:
getServerAdapter
in interfaceIAccessEvent
-
getResponseHeader
- Specified by:
getResponseHeader
in interfaceIAccessEvent
-
getResponseHeaderMap
- Specified by:
getResponseHeaderMap
in interfaceIAccessEvent
-
getResponseHeaderNameList
- Specified by:
getResponseHeaderNameList
in interfaceIAccessEvent
-
prepareForDeferredProcessing
- Specified by:
prepareForDeferredProcessing
in interfaceDeferredProcessingAware
-