public class ExceptionLoggingFilter extends OncePerRequestFilter
ALREADY_FILTERED_SUFFIXlogger| Constructor and Description |
|---|
ExceptionLoggingFilter() |
| Modifier and Type | Method and Description |
|---|---|
void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain)
Process the request.
|
protected Logger |
getLogger(HttpServletRequest request,
HttpServletResponse response,
Throwable t)
Get the logging destination.
|
protected void |
logException(HttpServletRequest request,
HttpServletResponse response,
Throwable t)
Log an exception caught by this instance and determined to be loggable by
shouldLogException(). |
protected boolean |
shouldLogException(HttpServletRequest request,
HttpServletResponse response,
Throwable t)
Determine if an exception caught by this instance should be logged.
|
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchaddRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContextpublic void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException
doFilterInternal in class OncePerRequestFilterIOExceptionServletExceptionshouldLogException()protected boolean shouldLogException(HttpServletRequest request, HttpServletResponse response, Throwable t)
The implementation in ExceptionLoggingFilter returns true except for
SocketException (typically caused by the client disconnecting) and ThreadDeath
(typically caused by virtual machine shutdown). Subclasses should override if necessary.
request - HTTP requestresponse - HTTP responset - exception caught by this instanceprotected void logException(HttpServletRequest request, HttpServletResponse response, Throwable t)
shouldLogException().
The implementation in ExceptionLoggingFilter logs the exception as an error via the logger
returned by getLogger(). Subclasses should override if necessary.
request - HTTP requestresponse - HTTP responset - exception caught by this instanceprotected Logger getLogger(HttpServletRequest request, HttpServletResponse response, Throwable t)
The implementation in ExceptionLoggingFilter uses the Logger returned by
LoggerFactory.getLogger(java.lang.String) when passed this instance's class as the parameter.
Subclasses should override if necessary.
request - HTTP requestresponse - HTTP responset - the exception about to be loggedCopyright © 2020. All rights reserved.