| java.lang.Object org.springframework.web.filter.GenericFilterBean org.springframework.web.filter.OncePerRequestFilter org.springframework.web.filter.AbstractRequestLoggingFilter
All known Subclasses: org.springframework.web.filter.CommonsRequestLoggingFilter, org.springframework.web.filter.Log4jNestedDiagnosticContextFilter, org.springframework.web.filter.ServletContextRequestLoggingFilter,
AbstractRequestLoggingFilter | abstract public class AbstractRequestLoggingFilter extends OncePerRequestFilter (Code) | | Base class for Filter s that perform logging operations before and after a
request is processed.
Subclasses should override the beforeRequest(HttpServletRequest, String)
and afterRequest(HttpServletRequest, String) methods to perform the actual
logging around the request.
Subclasses are passed the message to write to the log in the beforeRequest
and afterRequest methods. By default, only the URI of the request is logged.
However, setting the includeQueryString property to true will
cause the query string of the request to be included also.
Prefixes and suffixes for the before and after messages can be configured
using the beforeMessagePrefix , afterMessagePrefix ,
beforeMessageSuffix and afterMessageSuffix properties,
author: Rob Harrop author: Juergen Hoeller since: 1.2.5 See Also: AbstractRequestLoggingFilter.beforeRequest See Also: AbstractRequestLoggingFilter.afterRequest |
Method Summary | |
abstract protected void | afterRequest(HttpServletRequest request, String message) Concrete subclasses should implement this method to write a log message
after the request is processed. | abstract protected void | beforeRequest(HttpServletRequest request, String message) Concrete subclasses should implement this method to write a log message
before the request is processed. | protected String | createMessage(HttpServletRequest request, String prefix, String suffix) Create a log message for the given request, prefix and suffix. | protected void | doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) Forwards the request to the next filter in the chain and delegates
down to the subclasses to perform the actual request logging both
before and after the request is processed. | protected boolean | isIncludeQueryString() Return whether or not the query string should be included in the log message. | public void | setAfterMessagePrefix(String afterMessagePrefix) Set the value that should be prepended to the log message written
after a request is processed. | public void | setAfterMessageSuffix(String afterMessageSuffix) Set the value that should be appended to the log message written
after a request is processed. | public void | setBeforeMessagePrefix(String beforeMessagePrefix) Set the value that should be prepended to the log message written
before a request is processed. | public void | setBeforeMessageSuffix(String beforeMessageSuffix) Set the value that should be apppended to the log message written
before a request is processed. | public void | setIncludeQueryString(boolean includeQueryString) Set the whether or not the query string should be included in the log message. |
DEFAULT_AFTER_MESSAGE_PREFIX | final public static String DEFAULT_AFTER_MESSAGE_PREFIX(Code) | | |
DEFAULT_AFTER_MESSAGE_SUFFIX | final public static String DEFAULT_AFTER_MESSAGE_SUFFIX(Code) | | |
DEFAULT_BEFORE_MESSAGE_PREFIX | final public static String DEFAULT_BEFORE_MESSAGE_PREFIX(Code) | | |
DEFAULT_BEFORE_MESSAGE_SUFFIX | final public static String DEFAULT_BEFORE_MESSAGE_SUFFIX(Code) | | |
afterRequest | abstract protected void afterRequest(HttpServletRequest request, String message)(Code) | | Concrete subclasses should implement this method to write a log message
after the request is processed.
Parameters: request - current HTTP request Parameters: message - the message to log |
beforeRequest | abstract protected void beforeRequest(HttpServletRequest request, String message)(Code) | | Concrete subclasses should implement this method to write a log message
before the request is processed.
Parameters: request - current HTTP request Parameters: message - the message to log |
createMessage | protected String createMessage(HttpServletRequest request, String prefix, String suffix)(Code) | | Create a log message for the given request, prefix and suffix.
If includeQueryString is true then
the inner part of the log message will take the form
request_uri?query_string otherwise the message will
simply be of the form request_uri .
The final message is composed of the inner part as described
and the supplied prefix and suffix.
|
isIncludeQueryString | protected boolean isIncludeQueryString()(Code) | | Return whether or not the query string should be included in the log message.
|
setAfterMessagePrefix | public void setAfterMessagePrefix(String afterMessagePrefix)(Code) | | Set the value that should be prepended to the log message written
after a request is processed.
|
setAfterMessageSuffix | public void setAfterMessageSuffix(String afterMessageSuffix)(Code) | | Set the value that should be appended to the log message written
after a request is processed.
|
setBeforeMessagePrefix | public void setBeforeMessagePrefix(String beforeMessagePrefix)(Code) | | Set the value that should be prepended to the log message written
before a request is processed.
|
setBeforeMessageSuffix | public void setBeforeMessageSuffix(String beforeMessageSuffix)(Code) | | Set the value that should be apppended to the log message written
before a request is processed.
|
setIncludeQueryString | public void setIncludeQueryString(boolean includeQueryString)(Code) | | Set the whether or not the query string should be included in the log message.
Should be configured using an <init-param> in the filter
definition in web.xml .
|
Fields inherited from org.springframework.web.filter.OncePerRequestFilter | final public static String ALREADY_FILTERED_SUFFIX(Code)(Java Doc)
|
Fields inherited from org.springframework.web.filter.GenericFilterBean | final protected Log logger(Code)(Java Doc)
|
|
|