nl.surfnet.coin.shared.log.diagnostics
Class DiagnosticsLoggerFilter

java.lang.Object
  extended by nl.surfnet.coin.shared.log.diagnostics.DiagnosticsLoggerFilter
All Implemented Interfaces:
javax.servlet.Filter

public class DiagnosticsLoggerFilter
extends Object
implements javax.servlet.Filter

A Filter that uses MDC to log the aggregated diagnostic information, based on the outcome of the filter chain.

Usage: include this filter in the servlet filter chain. Mind that only filters coming after this one, and the actual servlet being called, will be subject to the processing by this filter.

Author:
Geert van der Ploeg

Nested Class Summary
static class DiagnosticsLoggerFilter.StatusExposingResponse
          Wrapper for HttpServletResponse that overrides all methods that write its status code, to expose the status to users.
 
Field Summary
static String MEMORY_APPENDER
           
static String MEMORY_LOGGER
           
 
Constructor Summary
DiagnosticsLoggerFilter()
           
 
Method Summary
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
           
 void init(javax.servlet.FilterConfig filterConfig)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMORY_APPENDER

public static final String MEMORY_APPENDER
See Also:
Constant Field Values

MEMORY_LOGGER

public static final String MEMORY_LOGGER
See Also:
Constant Field Values
Constructor Detail

DiagnosticsLoggerFilter

public DiagnosticsLoggerFilter()
Method Detail

init

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

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

destroy

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


Copyright © 2009–2013 SURFnet bv, The Netherlands. All rights reserved.