Package ch.qos.logback.access.spi
Class AccessEvent
- java.lang.Object
-
- ch.qos.logback.access.spi.AccessEvent
-
- All Implemented Interfaces:
IAccessEvent
,DeferredProcessingAware
,Serializable
public class AccessEvent extends Object implements Serializable, IAccessEvent
The Access module's internal representation of logging events. When the logging component instance is called in the container to log then aAccessEvent
instance is created. This instance is passed around to the different logback components.- Author:
- Ceki Gülcü, Sébastien Pennec
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface ch.qos.logback.access.spi.IAccessEvent
NA, SENTINEL
-
-
Constructor Summary
Constructors Constructor Description AccessEvent(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, ServerAdapter adapter)
-
Method Summary
-
-
-
Constructor Detail
-
AccessEvent
public AccessEvent(javax.servlet.http.HttpServletRequest httpRequest, javax.servlet.http.HttpServletResponse httpResponse, ServerAdapter adapter)
-
-
Method Detail
-
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
Returns the underlying HttpServletRequest. After serialization the returned value will be null.- Specified by:
getRequest
in interfaceIAccessEvent
- Returns:
-
getResponse
public javax.servlet.http.HttpServletResponse getResponse()
Returns the underlying HttpServletResponse. After serialization the returned value will be null.- Specified by:
getResponse
in interfaceIAccessEvent
- Returns:
-
getTimeStamp
public long 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
public void setTimeStamp(long timeStamp)
-
setThreadName
public void setThreadName(String threadName)
- Specified by:
setThreadName
in interfaceIAccessEvent
- Parameters:
threadName
- The threadName to set.
-
getThreadName
public String getThreadName()
- Specified by:
getThreadName
in interfaceIAccessEvent
-
getRequestURI
public String getRequestURI()
- Specified by:
getRequestURI
in interfaceIAccessEvent
-
getQueryString
public String getQueryString()
- Specified by:
getQueryString
in interfaceIAccessEvent
-
getRequestURL
public String getRequestURL()
The first line of the request.- Specified by:
getRequestURL
in interfaceIAccessEvent
-
getRemoteHost
public String getRemoteHost()
- Specified by:
getRemoteHost
in interfaceIAccessEvent
-
getRemoteUser
public String getRemoteUser()
- Specified by:
getRemoteUser
in interfaceIAccessEvent
-
getProtocol
public String getProtocol()
- Specified by:
getProtocol
in interfaceIAccessEvent
-
getMethod
public String getMethod()
- Specified by:
getMethod
in interfaceIAccessEvent
-
getSessionID
public String getSessionID()
- Specified by:
getSessionID
in interfaceIAccessEvent
-
getServerName
public String getServerName()
- Specified by:
getServerName
in interfaceIAccessEvent
-
getRemoteAddr
public String getRemoteAddr()
- Specified by:
getRemoteAddr
in interfaceIAccessEvent
-
getRequestHeader
public String getRequestHeader(String key)
- Specified by:
getRequestHeader
in interfaceIAccessEvent
-
getRequestHeaderNames
public Enumeration<String> getRequestHeaderNames()
- Specified by:
getRequestHeaderNames
in interfaceIAccessEvent
-
getRequestHeaderMap
public Map<String,String> getRequestHeaderMap()
- Specified by:
getRequestHeaderMap
in interfaceIAccessEvent
-
buildRequestHeaderMap
public void buildRequestHeaderMap()
-
buildRequestParameterMap
public void buildRequestParameterMap()
-
getRequestParameterMap
public Map<String,String[]> getRequestParameterMap()
- Specified by:
getRequestParameterMap
in interfaceIAccessEvent
-
getAttribute
public String getAttribute(String key)
- Specified by:
getAttribute
in interfaceIAccessEvent
-
getRequestParameter
public String[] getRequestParameter(String key)
- Specified by:
getRequestParameter
in interfaceIAccessEvent
-
getCookie
public String getCookie(String key)
- Specified by:
getCookie
in interfaceIAccessEvent
-
getContentLength
public long getContentLength()
- Specified by:
getContentLength
in interfaceIAccessEvent
-
getStatusCode
public int getStatusCode()
- Specified by:
getStatusCode
in interfaceIAccessEvent
-
getElapsedSeconds
public long getElapsedSeconds()
Description copied from interface:IAccessEvent
The number of seconds elapsed between receiving the request and logging it.- Specified by:
getElapsedSeconds
in interfaceIAccessEvent
-
getElapsedTime
public long getElapsedTime()
Description copied from interface:IAccessEvent
The time elapsed between receiving the request and logging it in milliseconds.- Specified by:
getElapsedTime
in interfaceIAccessEvent
-
getRequestContent
public String getRequestContent()
- Specified by:
getRequestContent
in interfaceIAccessEvent
-
getResponseContent
public String getResponseContent()
- Specified by:
getResponseContent
in interfaceIAccessEvent
-
getLocalPort
public int getLocalPort()
- Specified by:
getLocalPort
in interfaceIAccessEvent
-
getServerAdapter
public ServerAdapter getServerAdapter()
- Specified by:
getServerAdapter
in interfaceIAccessEvent
-
getResponseHeader
public String getResponseHeader(String key)
- Specified by:
getResponseHeader
in interfaceIAccessEvent
-
getResponseHeaderMap
public Map<String,String> getResponseHeaderMap()
- Specified by:
getResponseHeaderMap
in interfaceIAccessEvent
-
getResponseHeaderNameList
public List<String> getResponseHeaderNameList()
- Specified by:
getResponseHeaderNameList
in interfaceIAccessEvent
-
prepareForDeferredProcessing
public void prepareForDeferredProcessing()
- Specified by:
prepareForDeferredProcessing
in interfaceDeferredProcessingAware
-
-