com.atlassian.jira.web.filters.accesslog
Class AccessLogBuilder

java.lang.Object
  extended by com.atlassian.jira.web.filters.accesslog.AccessLogBuilder

public class AccessLogBuilder
extends Object

A builder class that can create access log entries

Since:
v3.13.2

Constructor Summary
AccessLogBuilder(javax.servlet.http.HttpServletRequest httpReq)
          Constructs a Apache CLF builder in the context of the given HttpServletRequest
 
Method Summary
 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

http://httpd.apache.org/docs/1.3/logs.html

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccessLogBuilder

public AccessLogBuilder(javax.servlet.http.HttpServletRequest httpReq)
Constructs a Apache CLF builder in the context of the given HttpServletRequest

Parameters:
httpReq - must be non null
Method Detail

getDateOfEvent

public org.joda.time.ReadableInstant getDateOfEvent()

getRequestId

public String getRequestId()

getHttpReq

public javax.servlet.http.HttpServletRequest getHttpReq()

getUrl

public String getUrl()

getUserName

public String getUserName()

getSessionId

public String getSessionId()

getResponseTimeMS

public long getResponseTimeMS()

getHttpStatusCode

public int getHttpStatusCode()

getResponseContentLength

public long getResponseContentLength()

setDateOfEvent

public AccessLogBuilder setDateOfEvent(org.joda.time.ReadableInstant dateOfEvent)
Sets the date of the log event. if this is not provide it defaults to now

Parameters:
dateOfEvent - the date of the log event
Returns:
this ApacheLogBuilder to allow a fluent style

setRequestId

public AccessLogBuilder setRequestId(String requestId)
Sets a request id into the builder

Parameters:
requestId - the id of the request
Returns:
this ApacheLogBuilder to allow a fluent style

setUrl

public AccessLogBuilder setUrl(String url)
Sets the URL of the builder

Parameters:
url - the ULR in play
Returns:
this ApacheLogBuilder to allow a fluent style

setUserName

public AccessLogBuilder setUserName(String userName)
Sets the user name to use in the log

Parameters:
userName - the name of the user
Returns:
this ApacheLogBuilder to allow a fluent style

setSessionId

public AccessLogBuilder setSessionId(String sessionId)
Sets the sessionId to use in this builder

Parameters:
sessionId - the session id in play
Returns:
this ApacheLogBuilder to allow a fluent style

setResponseTimeMS

public AccessLogBuilder setResponseTimeMS(long responseTimeMS)
Sets the response time in milliseconds

Parameters:
responseTimeMS - the resposne time in ms
Returns:
this ApacheLogBuilder to allow a fluent style

setHttpStatusCode

public AccessLogBuilder setHttpStatusCode(int httpStatusCode)
Sets the HTTP status code

Parameters:
httpStatusCode - the HTTP status code
Returns:
this ApacheLogBuilder to allow a fluent style

setResponseContentLength

public AccessLogBuilder setResponseContentLength(long responseContentLength)
Sets the response content length

Parameters:
responseContentLength - the response content length
Returns:
this ApacheLogBuilder to allow a fluent style

toApacheCombinedLogFormat

public String toApacheCombinedLogFormat()
This turns the builder into a Apache Combined Log Format line with a JIRA twist

http://httpd.apache.org/docs/1.3/logs.html

Returns:
a string representing the Apache CLF log entry


Copyright © 2002-2014 Atlassian. All Rights Reserved.