java.lang.Object
ch.qos.logback.access.common.spi.AccessEvent
- All Implemented Interfaces:
IAccessEvent
,ch.qos.logback.core.spi.DeferredProcessingAware
,Serializable
This class is the implementation of the IAccessEvent
interface.
Much of the processing done by the logack-access project revolves around this class.
- Author:
- Ceki Gülcü, Sébastien Pennec
- See Also:
-
Field Summary
Fields inherited from interface ch.qos.logback.access.common.spi.IAccessEvent
NA, SENTINEL
-
Constructor Summary
ConstructorDescriptionAccessEvent
(ch.qos.logback.core.Context context, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, ServerAdapter adapter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
getAttribute
(String key) long
List
<jakarta.servlet.http.Cookie> Return the list of cookies in the httpRequest.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
jakarta.servlet.http.HttpServletRequest
Returns the underlying HttpServletRequest.getRequestHeader
(String key) String[]
The first line of the request.jakarta.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(ch.qos.logback.core.Context context, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.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
-
getCookies
Return the list of cookies in the httpRequest. The list is created if it did not exist previously.- Specified by:
getCookies
in interfaceIAccessEvent
- Returns:
- a list of cookies in the httpRequest, the returned list can be empty but not null
- Since:
- version 2.0.2
-
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 interfacech.qos.logback.core.spi.DeferredProcessingAware
-