Package com.netcetera.girders.web
Class ServletExceptionLoggingFilter
java.lang.Object
org.springframework.web.filter.GenericFilterBean
org.springframework.web.filter.OncePerRequestFilter
org.springframework.web.filter.AbstractRequestLoggingFilter
com.netcetera.girders.web.ServletExceptionLoggingFilter
- All Implemented Interfaces:
jakarta.servlet.Filter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.EnvironmentAware,org.springframework.core.env.EnvironmentCapable,org.springframework.web.context.ServletContextAware
public class ServletExceptionLoggingFilter
extends org.springframework.web.filter.AbstractRequestLoggingFilter
ServletExceptionLoggingFilter adds exception logging capability. A servlet
filter can be declared in the
web.xml file.
<blockquote>
in web.xml, add a section like this:
<filter>
<filter-name>exceptionLoggingFilter</filter-name>
<filter-class>
com.netcetera.girders.web.filter.ServletExceptionLoggingFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>exceptionLoggingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</blockquote>
-
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_SUFFIXFields inherited from class org.springframework.web.filter.OncePerRequestFilter
ALREADY_FILTERED_SUFFIXFields inherited from class org.springframework.web.filter.GenericFilterBean
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterRequest(jakarta.servlet.http.HttpServletRequest request, String message) Null implementation, does nothing.protected voidbeforeRequest(jakarta.servlet.http.HttpServletRequest request, String message) Null implementation, does nothing.protected voiddoFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) protected voidMethods inherited from class org.springframework.web.filter.AbstractRequestLoggingFilter
createMessage, getHeaderPredicate, getMaxPayloadLength, getMessagePayload, isIncludeClientInfo, isIncludeHeaders, isIncludePayload, isIncludeQueryString, setAfterMessagePrefix, setAfterMessageSuffix, setBeforeMessagePrefix, setBeforeMessageSuffix, setHeaderPredicate, setIncludeClientInfo, setIncludeHeaders, setIncludePayload, setIncludeQueryString, setMaxPayloadLength, shouldLog, shouldNotFilterAsyncDispatchMethods inherited from class org.springframework.web.filter.OncePerRequestFilter
doFilter, doFilterNestedErrorDispatch, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterErrorDispatchMethods inherited from class org.springframework.web.filter.GenericFilterBean
addRequiredProperty, afterPropertiesSet, createEnvironment, destroy, getEnvironment, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, setBeanName, setEnvironment, setServletContext
-
Constructor Details
-
ServletExceptionLoggingFilter
public ServletExceptionLoggingFilter()C'tor.
-
-
Method Details
-
initFilterBean
protected void initFilterBean() throws jakarta.servlet.ServletException- Overrides:
initFilterBeanin classorg.springframework.web.filter.GenericFilterBean- Throws:
jakarta.servlet.ServletException
-
doFilterInternal
protected void doFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain) throws jakarta.servlet.ServletException, IOException - Overrides:
doFilterInternalin classorg.springframework.web.filter.AbstractRequestLoggingFilter- Throws:
jakarta.servlet.ServletExceptionIOException
-
beforeRequest
Null implementation, does nothing.- Specified by:
beforeRequestin classorg.springframework.web.filter.AbstractRequestLoggingFilter- Parameters:
request- requestmessage- message
-
afterRequest
Null implementation, does nothing.- Specified by:
afterRequestin classorg.springframework.web.filter.AbstractRequestLoggingFilter- Parameters:
request- requestmessage- message
-