Class SLF4JMDCServletFilter

java.lang.Object
net.shibboleth.idp.log.SLF4JMDCServletFilter
All Implemented Interfaces:
javax.servlet.Filter

public class SLF4JMDCServletFilter extends Object implements javax.servlet.Filter
Servlet filter that sets some interesting MDC attributes as the request comes in and clears the MDC as the response is returned.
  • Field Details

    • SERVER_ADDRESS_MDC_ATTRIBUTE

      @Nonnull @NotEmpty public static final String SERVER_ADDRESS_MDC_ATTRIBUTE
      MDC attribute name for host name of the server to which the current request was sent.
      See Also:
    • SERVER_PORT_MDC_ATTRIBUTE

      @Nonnull @NotEmpty public static final String SERVER_PORT_MDC_ATTRIBUTE
      MDC attribute name for port number to which the current request was sent.
      See Also:
    • CLIENT_ADDRESS_MDC_ATTRIBUTE

      @Nonnull @NotEmpty public static final String CLIENT_ADDRESS_MDC_ATTRIBUTE
      MDC attribute name for client address.
      See Also:
    • JSESSIONID_MDC_ATTRIBUTE

      @Nonnull @NotEmpty public static final String JSESSIONID_MDC_ATTRIBUTE
      MDC attribute name for container session ID.
      See Also:
    • createSession

      private boolean createSession
      Whether to create a session if it doesn't already exist.
  • Constructor Details

    • SLF4JMDCServletFilter

      public SLF4JMDCServletFilter()
  • Method Details

    • doFilter

      public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
      Specified by:
      doFilter in interface javax.servlet.Filter
      Throws:
      IOException
      javax.servlet.ServletException
    • init

      public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException
      Specified by:
      init in interface javax.servlet.Filter
      Throws:
      javax.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface javax.servlet.Filter