public class AccessLogFilter extends Object implements javax.servlet.Filter
Constructor and Description |
---|
AccessLogFilter() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Does nothing
|
void |
doFilter(javax.servlet.ServletRequest servletRequest,
javax.servlet.ServletResponse servletResponse,
javax.servlet.FilterChain chain)
Creates logs if INFO logging level is set and URL is "interesting" according to
isInterestingUrl(String) . |
protected String |
getEndText(int httpStatusCode,
String startText,
long memDiff,
long timeDiff) |
protected String |
getStartText(String url,
javax.servlet.http.HttpServletRequest request,
long startMem) |
void |
init(javax.servlet.FilterConfig filterConfig)
Does nothing but prints INFO log message
|
protected boolean |
isInterestingUrl(String url)
Returns true if the given URL is of our interest.
|
static void |
setUsernameLoggingEnabled(boolean value) |
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
filterConfig
- not usedjavax.servlet.ServletException
- not thrownpublic void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
isInterestingUrl(String)
.doFilter
in interface javax.servlet.Filter
servletRequest
- requestservletResponse
- responsechain
- filter chainIOException
- if another filter in the filter chain throws itjavax.servlet.ServletException
- if another filter in the filter chain throws itprotected String getStartText(String url, javax.servlet.http.HttpServletRequest request, long startMem)
protected String getEndText(int httpStatusCode, String startText, long memDiff, long timeDiff)
protected boolean isInterestingUrl(String url)
url
- url to checkpublic void destroy()
destroy
in interface javax.servlet.Filter
public static void setUsernameLoggingEnabled(boolean value)
Copyright © 2023 Atlassian Software Systems Pty Ltd. All rights reserved.