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

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

public class AccessLogBuilder
extends java.lang.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()
           
 java.lang.String getRequestId()
           
 long getResponseContentLength()
           
 long getResponseTimeMS()
           
 java.lang.String getSessionId()
           
 java.lang.String getUrl()
           
 java.lang.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(java.lang.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(java.lang.String sessionId)
          Sets the sessionId to use in this builder
 AccessLogBuilder setUrl(java.lang.String url)
          Sets the URL of the builder
 AccessLogBuilder setUserName(java.lang.String userName)
          Sets the user name to use in the log
 java.lang.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 java.lang.String getRequestId()

getHttpReq

public javax.servlet.http.HttpServletRequest getHttpReq()

getUrl

public java.lang.String getUrl()

getUserName

public java.lang.String getUserName()

getSessionId

public java.lang.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(java.lang.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(java.lang.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(java.lang.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(java.lang.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 java.lang.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-2010 Atlassian. All Rights Reserved.