public class WebRequestTraceFilter extends OncePerRequestFilter implements Ordered
Filter
that logs all requests to a TraceRepository
.ALREADY_FILTERED_SUFFIX
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Constructor and Description |
---|
WebRequestTraceFilter(TraceRepository repository,
TraceProperties properties)
Create a new
WebRequestTraceFilter instance. |
Modifier and Type | Method and Description |
---|---|
protected void |
doFilterInternal(HttpServletRequest request,
HttpServletResponse response,
FilterChain filterChain) |
protected void |
enhanceTrace(Map<String,Object> trace,
HttpServletResponse response) |
int |
getOrder() |
protected Map<String,Object> |
getTrace(HttpServletRequest request) |
protected void |
postProcessRequestHeaders(Map<String,Object> headers)
Post process request headers before they are added to the trace.
|
void |
setDumpRequests(boolean dumpRequests)
Debugging feature.
|
void |
setErrorAttributes(ErrorAttributes errorAttributes) |
void |
setOrder(int order) |
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatch
addRequiredProperty, afterPropertiesSet, destroy, getFilterConfig, getFilterName, getServletContext, init, initBeanWrapper, initFilterBean, setBeanName, setEnvironment, setServletContext
public WebRequestTraceFilter(TraceRepository repository, TraceProperties properties)
WebRequestTraceFilter
instance.repository
- the trace repositoryproperties
- the trace propertiespublic void setDumpRequests(boolean dumpRequests)
dumpRequests
- if requests should be loggedpublic void setOrder(int order)
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException
doFilterInternal
in class OncePerRequestFilter
ServletException
IOException
protected Map<String,Object> getTrace(HttpServletRequest request)
protected void postProcessRequestHeaders(Map<String,Object> headers)
headers
- a mutable map containing the request headers to traceprotected void enhanceTrace(Map<String,Object> trace, HttpServletResponse response)
public void setErrorAttributes(ErrorAttributes errorAttributes)
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.