类 Log4jNestedDiagnosticContextInterceptor
- java.lang.Object
- org.springframework.web.context.request.Log4jNestedDiagnosticContextInterceptor
@Deprecated public class Log4jNestedDiagnosticContextInterceptor extends Object implements AsyncWebRequestInterceptor
已过时。as of Spring 4.2.1, in favor of Apache Log4j 2 (following Apache's EOL declaration for log4j 1.x)Request logging interceptor that adds a request context message to the Log4J nested diagnostic context (NDC) before the request is processed, removing it again after the request is processed.- 从以下版本开始:
- 2.5
- 作者:
- Juergen Hoeller
- 另请参阅:
NDC.push(String)
,NDC.pop()
字段概要
字段 修饰符和类型 字段 说明 protected Logger
log4jLogger
已过时。Logger available to subclasses
构造器概要
构造器 构造器 说明 Log4jNestedDiagnosticContextInterceptor()
已过时。
方法概要
所有方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 void
afterCompletion(WebRequest request, Exception ex)
已过时。Removes the log message from the Log4J NDC after the request is processed.void
afterConcurrentHandlingStarted(WebRequest request)
已过时。Removes the log message from the Log4J NDC when the processing thread is exited after the start of asynchronous request handling.protected String
getNestedDiagnosticContextMessage(WebRequest request)
已过时。Determine the message to be pushed onto the Log4J nested diagnostic context.protected boolean
isIncludeClientInfo()
已过时。Return whether or not the session id and user name should be included in the log message.void
postHandle(WebRequest request, ModelMap model)
已过时。Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).void
preHandle(WebRequest request)
已过时。Adds a message the Log4J NDC before the request is processed.void
setIncludeClientInfo(boolean includeClientInfo)
已过时。Set whether or not the session id and user name should be included in the log message.
字段详细资料
log4jLogger
protected final Logger log4jLogger
已过时。Logger available to subclasses
构造器详细资料
Log4jNestedDiagnosticContextInterceptor
public Log4jNestedDiagnosticContextInterceptor()
已过时。
方法详细资料
setIncludeClientInfo
public void setIncludeClientInfo(boolean includeClientInfo)
已过时。Set whether or not the session id and user name should be included in the log message.
isIncludeClientInfo
protected boolean isIncludeClientInfo()
已过时。Return whether or not the session id and user name should be included in the log message.
preHandle
public void preHandle(WebRequest request) throws Exception
已过时。Adds a message the Log4J NDC before the request is processed.- 指定者:
preHandle
在接口中WebRequestInterceptor
- 参数:
request
- the current web request- 抛出:
Exception
- in case of errors
getNestedDiagnosticContextMessage
protected String getNestedDiagnosticContextMessage(WebRequest request)
已过时。Determine the message to be pushed onto the Log4J nested diagnostic context.Default is the request object's
getDescription
result.- 参数:
request
- current HTTP request- 返回:
- the message to be pushed onto the Log4J NDC
- 另请参阅:
WebRequest.getDescription(boolean)
,isIncludeClientInfo()
postHandle
public void postHandle(WebRequest request, ModelMap model) throws Exception
已过时。从接口复制的说明:WebRequestInterceptor
Intercept the execution of a request handler after its successful invocation, right before view rendering (if any).Allows for modifying context resources after successful handler execution (for example, flushing a Hibernate Session).
- 指定者:
postHandle
在接口中WebRequestInterceptor
- 参数:
request
- the current web requestmodel
- the map of model objects that will be exposed to the view (may benull
). Can be used to analyze the exposed model and/or to add further model attributes, if desired.- 抛出:
Exception
- in case of errors
afterCompletion
public void afterCompletion(WebRequest request, Exception ex) throws Exception
已过时。Removes the log message from the Log4J NDC after the request is processed.- 指定者:
afterCompletion
在接口中WebRequestInterceptor
- 参数:
request
- the current web requestex
- exception thrown on handler execution, if any- 抛出:
Exception
- in case of errors
afterConcurrentHandlingStarted
public void afterConcurrentHandlingStarted(WebRequest request)
已过时。Removes the log message from the Log4J NDC when the processing thread is exited after the start of asynchronous request handling.- 指定者:
afterConcurrentHandlingStarted
在接口中AsyncWebRequestInterceptor
- 参数:
request
- the current request