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_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

    Constructors
    Constructor
    Description
    C'tor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    afterRequest(jakarta.servlet.http.HttpServletRequest request, String message)
    Null implementation, does nothing.
    protected void
    beforeRequest(jakarta.servlet.http.HttpServletRequest request, String message)
    Null implementation, does nothing.
    protected void
    doFilterInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain filterChain)
     
    protected void
     

    Methods 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, 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, setBeanName, setEnvironment, setServletContext

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ServletExceptionLoggingFilter

      public ServletExceptionLoggingFilter()
      C'tor.
  • Method Details

    • initFilterBean

      protected void initFilterBean() throws jakarta.servlet.ServletException
      Overrides:
      initFilterBean in class org.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:
      doFilterInternal in class org.springframework.web.filter.AbstractRequestLoggingFilter
      Throws:
      jakarta.servlet.ServletException
      IOException
    • beforeRequest

      protected void beforeRequest(jakarta.servlet.http.HttpServletRequest request, String message)
      Null implementation, does nothing.
      Specified by:
      beforeRequest in class org.springframework.web.filter.AbstractRequestLoggingFilter
      Parameters:
      request - request
      message - message
    • afterRequest

      protected void afterRequest(jakarta.servlet.http.HttpServletRequest request, String message)
      Null implementation, does nothing.
      Specified by:
      afterRequest in class org.springframework.web.filter.AbstractRequestLoggingFilter
      Parameters:
      request - request
      message - message