Package org.springframework.web.filter
Class ServletContextRequestLoggingFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.web.filter.AbstractRequestLoggingFilter
org.springframework.web.filter.ServletContextRequestLoggingFilter
- All Implemented Interfaces:
Filter
,Aware
,BeanNameAware
,DisposableBean
,InitializingBean
,EnvironmentAware
,EnvironmentCapable
,ServletContextAware
Simple request logging filter that writes the request URI
(and optionally the query string) to the ServletContext log.
- Since:
- 1.2.5
- Author:
- Juergen Hoeller
- 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)
ServletContext.log(String)
-
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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.Methods inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
createMessage, doFilterInternal, getHeaderPredicate, getMaxPayloadLength, getMessagePayload, isIncludeClientInfo, isIncludeHeaders, isIncludePayload, isIncludeQueryString, setAfterMessagePrefix, setAfterMessageSuffix, setBeforeMessagePrefix, setBeforeMessageSuffix, setHeaderPredicate, setIncludeClientInfo, setIncludeHeaders, setIncludePayload, setIncludeQueryString, setMaxPayloadLength, shouldLog, shouldNotFilterAsyncDispatch
Methods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterErrorDispatch
Methods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
ServletContextRequestLoggingFilter
public ServletContextRequestLoggingFilter()
-
-
Method Details
-
beforeRequest
Writes a log message before the request is processed.- Specified by:
beforeRequest
in classAbstractRequestLoggingFilter
- Parameters:
request
- current HTTP requestmessage
- the message to log
-
afterRequest
Writes a log message after the request is processed.- Specified by:
afterRequest
in classAbstractRequestLoggingFilter
- Parameters:
request
- current HTTP requestmessage
- the message to log
-