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

java.lang.Object
  extended by com.atlassian.jira.web.filters.accesslog.AccessLogFilter
All Implemented Interfaces:
javax.servlet.Filter

public class AccessLogFilter
extends Object
implements javax.servlet.Filter

Logs the JIRA user name and request URL via log4j to a special log file in Apache Combined Log Format (with response time)

This also works in concert with the com.atlassian.jira.soap.axis.JiraSoapAxisLogger to pass information between the layers via HttpServletRequest attributes.


Field Summary
static AtomicLong concurrentRequests
          This atomic long gauge goes up and down for every request that hits JIRA
static String JIRA_REQUEST_ASESSIONID
          This constant is used to indicate the ASESSIONID
static String JIRA_REQUEST_ID
          This constant is used to indicate the request id
static String JIRA_REQUEST_START_MILLIS
          This constant is used to indicate the start time of the request
static String JIRA_REQUEST_TIME_MICROS
          This constant is used to indicate the time the request took in microseconds
static String JIRA_REQUEST_USER_NAME
          This constant is used by the SOAP code to place the SOAP username into the request
static String JIRA_RPC_SOAP_SESSIONID
          This constant is used by the SOAP code to place the SOAP session id into the request
static String JIRA_RPC_SOAP_URLSUFFIX
          This constant is used by the SOAP code to place the SOAP method url suffix into the request
static String JIRA_RPC_SOAP_USERNAME
          This constant is used by the SOAP code to place the SOAP username into the request
static AtomicLong requestCounter
          This atomic long counter increments for every new request that hits JIRA
 
Constructor Summary
AccessLogFilter()
           
 
Method Summary
 void destroy()
          Does nothing
 void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
          Creates logs if INFO logging level is set and URL is "interesting" according to isInterestingUrl(String).
 void init(javax.servlet.FilterConfig filterConfig)
          Does nothing but prints INFO log message
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JIRA_RPC_SOAP_USERNAME

public static final String JIRA_RPC_SOAP_USERNAME
This constant is used by the SOAP code to place the SOAP username into the request

See Also:
Constant Field Values

JIRA_RPC_SOAP_URLSUFFIX

public static final String JIRA_RPC_SOAP_URLSUFFIX
This constant is used by the SOAP code to place the SOAP method url suffix into the request

See Also:
Constant Field Values

JIRA_RPC_SOAP_SESSIONID

public static final String JIRA_RPC_SOAP_SESSIONID
This constant is used by the SOAP code to place the SOAP session id into the request

See Also:
Constant Field Values

JIRA_REQUEST_USER_NAME

public static final String JIRA_REQUEST_USER_NAME
This constant is used by the SOAP code to place the SOAP username into the request

See Also:
Constant Field Values

JIRA_REQUEST_START_MILLIS

public static final String JIRA_REQUEST_START_MILLIS
This constant is used to indicate the start time of the request

See Also:
Constant Field Values

JIRA_REQUEST_TIME_MICROS

public static final String JIRA_REQUEST_TIME_MICROS
This constant is used to indicate the time the request took in microseconds

See Also:
Constant Field Values

JIRA_REQUEST_ID

public static final String JIRA_REQUEST_ID
This constant is used to indicate the request id

See Also:
Constant Field Values

JIRA_REQUEST_ASESSIONID

public static final String JIRA_REQUEST_ASESSIONID
This constant is used to indicate the ASESSIONID

See Also:
Constant Field Values

requestCounter

public static final AtomicLong requestCounter
This atomic long counter increments for every new request that hits JIRA


concurrentRequests

public static final AtomicLong concurrentRequests
This atomic long gauge goes up and down for every request that hits JIRA

Constructor Detail

AccessLogFilter

public AccessLogFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Does nothing but prints INFO log message

Specified by:
init in interface javax.servlet.Filter
Parameters:
filterConfig - not used
Throws:
javax.servlet.ServletException - not thrown

doFilter

public void doFilter(javax.servlet.ServletRequest servletRequest,
                     javax.servlet.ServletResponse servletResponse,
                     javax.servlet.FilterChain filterChain)
              throws IOException,
                     javax.servlet.ServletException
Creates logs if INFO logging level is set and URL is "interesting" according to isInterestingUrl(String).

Specified by:
doFilter in interface javax.servlet.Filter
Parameters:
servletRequest - request
servletResponse - response
filterChain - filter chain
Throws:
IOException - if another filter in the filter chain throws it
javax.servlet.ServletException - if another filter in the filter chain throws it

destroy

public void destroy()
Does nothing

Specified by:
destroy in interface javax.servlet.Filter


Copyright © 2002-2009 Atlassian. All Rights Reserved.