Package net.shibboleth.idp.log
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 Summary
Fields Modifier and Type Field Description static StringCLIENT_ADDRESS_MDC_ATTRIBUTEMDC attribute name for client address.private booleancreateSessionWhether to create a session if it doesn't already exist.static StringJSESSIONID_MDC_ATTRIBUTEMDC attribute name for container session ID.static StringSERVER_ADDRESS_MDC_ATTRIBUTEMDC attribute name for host name of the server to which the current request was sent.static StringSERVER_PORT_MDC_ATTRIBUTEMDC attribute name for port number to which the current request was sent.
-
Constructor Summary
Constructors Constructor Description SLF4JMDCServletFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)voidinit(javax.servlet.FilterConfig filterConfig)
-
-
-
Field Detail
-
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:
- Constant Field Values
-
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:
- Constant Field Values
-
CLIENT_ADDRESS_MDC_ATTRIBUTE
@Nonnull @NotEmpty public static final String CLIENT_ADDRESS_MDC_ATTRIBUTE
MDC attribute name for client address.- See Also:
- Constant Field Values
-
JSESSIONID_MDC_ATTRIBUTE
@Nonnull @NotEmpty public static final String JSESSIONID_MDC_ATTRIBUTE
MDC attribute name for container session ID.- See Also:
- Constant Field Values
-
createSession
private boolean createSession
Whether to create a session if it doesn't already exist.
-
-
Method Detail
-
doFilter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException- Specified by:
doFilterin interfacejavax.servlet.Filter- Throws:
IOExceptionjavax.servlet.ServletException
-
init
public void init(javax.servlet.FilterConfig filterConfig) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Filter- Throws:
javax.servlet.ServletException
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Filter
-
-