public class CommonsRequestLoggingFilter extends AbstractRequestLoggingFilter
AbstractRequestLoggingFilter.setIncludeQueryString(boolean)
,
AbstractRequestLoggingFilter.setBeforeMessagePrefix(java.lang.String)
,
AbstractRequestLoggingFilter.setBeforeMessageSuffix(java.lang.String)
,
AbstractRequestLoggingFilter.setAfterMessagePrefix(java.lang.String)
,
AbstractRequestLoggingFilter.setAfterMessageSuffix(java.lang.String)
,
Log.debug(Object)
DEFAULT_AFTER_MESSAGE_PREFIX, DEFAULT_AFTER_MESSAGE_SUFFIX, DEFAULT_BEFORE_MESSAGE_PREFIX, DEFAULT_BEFORE_MESSAGE_SUFFIX
ALREADY_FILTERED_SUFFIX
logger
Constructor and Description |
---|
CommonsRequestLoggingFilter() |
Modifier and Type | Method and Description |
---|---|
protected void |
afterRequest(HttpServletRequest request,
String message)
Writes a log message after the request is processed.
|
protected void |
beforeRequest(HttpServletRequest request,
String message)
Writes a log message before the request is processed.
|
protected boolean |
shouldLog(HttpServletRequest request)
Determine whether to call the
AbstractRequestLoggingFilter.beforeRequest(javax.servlet.http.HttpServletRequest, java.lang.String) /AbstractRequestLoggingFilter.afterRequest(javax.servlet.http.HttpServletRequest, java.lang.String)
methods for the current request, i.e. |
createMessage, doFilterInternal, getMaxPayloadLength, isIncludeClientInfo, isIncludeHeaders, isIncludePayload, isIncludeQueryString, setAfterMessagePrefix, setAfterMessageSuffix, setBeforeMessagePrefix, setBeforeMessageSuffix, setIncludeClientInfo, setIncludeHeaders, setIncludePayload, setIncludeQueryString, setMaxPayloadLength, shouldNotFilterAsyncDispatch
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterErrorDispatch
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
protected boolean shouldLog(HttpServletRequest request)
AbstractRequestLoggingFilter
AbstractRequestLoggingFilter.beforeRequest(javax.servlet.http.HttpServletRequest, java.lang.String)
/AbstractRequestLoggingFilter.afterRequest(javax.servlet.http.HttpServletRequest, java.lang.String)
methods for the current request, i.e. whether logging is currently active
(and the log message is worth building).
The default implementation always returns true
. Subclasses may
override this with a log level check.
shouldLog
in class AbstractRequestLoggingFilter
request
- current HTTP requesttrue
if the before/after method should get called;
false
otherwiseprotected void beforeRequest(HttpServletRequest request, String message)
beforeRequest
in class AbstractRequestLoggingFilter
request
- current HTTP requestmessage
- the message to logprotected void afterRequest(HttpServletRequest request, String message)
afterRequest
in class AbstractRequestLoggingFilter
request
- current HTTP requestmessage
- the message to log