public class AccessLogBuilder extends Object
Constructor and Description |
---|
AccessLogBuilder(javax.servlet.http.HttpServletRequest httpReq)
Constructs a Apache CLF builder in the context of the given HttpServletRequest
|
Modifier and Type | Method and Description |
---|---|
org.joda.time.ReadableInstant |
getDateOfEvent() |
javax.servlet.http.HttpServletRequest |
getHttpReq() |
int |
getHttpStatusCode() |
String |
getRequestId() |
long |
getResponseContentLength() |
long |
getResponseTimeMS() |
String |
getSessionId() |
String |
getUrl() |
String |
getUserName() |
AccessLogBuilder |
setDateOfEvent(org.joda.time.ReadableInstant dateOfEvent)
Sets the date of the log event.
|
AccessLogBuilder |
setHttpStatusCode(int httpStatusCode)
Sets the HTTP status code
|
AccessLogBuilder |
setRequestId(String requestId)
Sets a request id into the builder
|
AccessLogBuilder |
setResponseContentLength(long responseContentLength)
Sets the response content length
|
AccessLogBuilder |
setResponseTimeMS(long responseTimeMS)
Sets the response time in milliseconds
|
AccessLogBuilder |
setSessionId(String sessionId)
Sets the sessionId to use in this builder
|
AccessLogBuilder |
setUrl(String url)
Sets the URL of the builder
|
AccessLogBuilder |
setUserName(String userName)
Sets the user name to use in the log
|
String |
toApacheCombinedLogFormat()
This turns the builder into a Apache Combined Log Format line with a JIRA twist
|
public AccessLogBuilder(javax.servlet.http.HttpServletRequest httpReq)
httpReq
- must be non nullpublic org.joda.time.ReadableInstant getDateOfEvent()
public String getRequestId()
public javax.servlet.http.HttpServletRequest getHttpReq()
public String getUrl()
public String getUserName()
public String getSessionId()
public long getResponseTimeMS()
public int getHttpStatusCode()
public long getResponseContentLength()
public AccessLogBuilder setDateOfEvent(org.joda.time.ReadableInstant dateOfEvent)
dateOfEvent
- the date of the log eventpublic AccessLogBuilder setRequestId(String requestId)
requestId
- the id of the requestpublic AccessLogBuilder setUrl(String url)
url
- the ULR in playpublic AccessLogBuilder setUserName(String userName)
userName
- the name of the userpublic AccessLogBuilder setSessionId(String sessionId)
sessionId
- the session id in playpublic AccessLogBuilder setResponseTimeMS(long responseTimeMS)
responseTimeMS
- the resposne time in mspublic AccessLogBuilder setHttpStatusCode(int httpStatusCode)
httpStatusCode
- the HTTP status codepublic AccessLogBuilder setResponseContentLength(long responseContentLength)
responseContentLength
- the response content lengthpublic String toApacheCombinedLogFormat()
http://httpd.apache.org/docs/1.3/logs.html
Copyright © 2002-2022 Atlassian. All Rights Reserved.