Spring Framework

org.springframework.web.filter
Class CommonsRequestLoggingFilter

java.lang.Object
  extended by org.springframework.web.filter.GenericFilterBean
      extended by org.springframework.web.filter.OncePerRequestFilter
          extended by org.springframework.web.filter.AbstractRequestLoggingFilter
              extended by org.springframework.web.filter.CommonsRequestLoggingFilter
All Implemented Interfaces:
javax.servlet.Filter, Aware, BeanNameAware, DisposableBean, InitializingBean, EnvironmentAware, ServletContextAware

public class CommonsRequestLoggingFilter
extends AbstractRequestLoggingFilter

Simple request logging filter that writes the request URI (and optionally the query string) to the Commons Log.

Since:
1.2.5
Author:
Rob Harrop
See Also:
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)

Field Summary
 
Fields inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
DEFAULT_AFTER_MESSAGE_PREFIX, DEFAULT_AFTER_MESSAGE_SUFFIX, DEFAULT_BEFORE_MESSAGE_PREFIX, DEFAULT_BEFORE_MESSAGE_SUFFIX
 
Fields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIX
 
Fields inherited from class org.springframework.web.filter.GenericFilterBean
logger
 
Constructor Summary
CommonsRequestLoggingFilter()
           
 
Method Summary
protected  void afterRequest(javax.servlet.http.HttpServletRequest request, java.lang.String message)
          Writes a log message after the request is processed.
protected  void beforeRequest(javax.servlet.http.HttpServletRequest request, java.lang.String message)
          Writes a log message before the request is processed.
 
Methods inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
createMessage, doFilterInternal, getMaxPayloadLength, isIncludeClientInfo, isIncludePayload, isIncludeQueryString, setAfterMessagePrefix, setAfterMessageSuffix, setBeforeMessagePrefix, setBeforeMessageSuffix, setIncludeClientInfo, setIncludePayload, setIncludeQueryString, setMaxPayloadLength
 
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, getAlreadyFilteredAttributeName, shouldNotFilter
 
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsRequestLoggingFilter

public CommonsRequestLoggingFilter()
Method Detail

beforeRequest

protected void beforeRequest(javax.servlet.http.HttpServletRequest request,
                             java.lang.String message)
Writes a log message before the request is processed.

Specified by:
beforeRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log

afterRequest

protected void afterRequest(javax.servlet.http.HttpServletRequest request,
                            java.lang.String message)
Writes a log message after the request is processed.

Specified by:
afterRequest in class AbstractRequestLoggingFilter
Parameters:
request - current HTTP request
message - the message to log

Spring Framework