public class RequestLoggingFilter
extends org.springframework.web.filter.OncePerRequestFilter
| Modifier and Type | Class and Description |
|---|---|
class |
RequestLoggingFilter.RequestLoggingFilterWrapper
A request wrapper that logs incoming requests.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
AFTER_REQUEST_LOG_MESSAGE_PREFIX |
static String |
DEFAULT_LOG_MESSAGE_PREFIX |
static String |
DEFAULT_LOG_MESSAGE_SUFFIX |
| Constructor and Description |
|---|
RequestLoggingFilter() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain) |
protected Integer |
getMaxPayloadLength()
Return the maximum length of the payload body to be included in the log message.
|
protected boolean |
isIncludeClientInfo()
Return whether or not the client address and session id should be included in the log message.
|
protected boolean |
isIncludePayload()
Return whether or not the request payload (body) should be included in the log message.
|
protected boolean |
isIncludeQueryString()
Return whether or not the query string should be included in the log message.
|
void |
setIncludeClientInfo(boolean includeClientInfo)
Set whether or not the client address and session id should be included in the log message.
|
void |
setIncludePayload(boolean includePayload)
Set whether or not the request payload (body) should be included in the log message.
|
void |
setIncludeQueryString(boolean includeQueryString)
Set whether or not the query string should be included in the log message.
|
void |
setLogMessagePrefix(String logMessagePrefix)
Set the value that should be prepended to the log message.
|
void |
setLogMessageSuffix(String logMessageSuffix)
Set the value that should be appended to the log message.
|
void |
setMaxPayloadLength(Integer maxPayloadLength)
Sets the maximum length of the payload body to be included in the log message.
|
doFilter, getAlreadyFilteredAttributeName, isAsyncDispatch, isAsyncStarted, shouldNotFilter, shouldNotFilterAsyncDispatch, shouldNotFilterErrorDispatchpublic static final String DEFAULT_LOG_MESSAGE_PREFIX
public static final String DEFAULT_LOG_MESSAGE_SUFFIX
public static final String AFTER_REQUEST_LOG_MESSAGE_PREFIX
public void setIncludeQueryString(boolean includeQueryString)
protected boolean isIncludeQueryString()
public void setIncludeClientInfo(boolean includeClientInfo)
protected boolean isIncludeClientInfo()
public void setIncludePayload(boolean includePayload)
protected boolean isIncludePayload()
public void setMaxPayloadLength(Integer maxPayloadLength)
protected Integer getMaxPayloadLength()
public void setLogMessagePrefix(String logMessagePrefix)
public void setLogMessageSuffix(String logMessageSuffix)
protected void doFilterInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.FilterChain filterChain)
throws javax.servlet.ServletException,
IOException
doFilterInternal in class org.springframework.web.filter.OncePerRequestFilterjavax.servlet.ServletExceptionIOExceptionCopyright © 2019. All rights reserved.