Java Code Examples for org.apache.log4j.NDC#getDepth()

The following examples show how to use org.apache.log4j.NDC#getDepth() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Log4jNestedDiagnosticContextInterceptor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the log message from the Log4J NDC after the request is processed.
 */
@Override
public void afterCompletion(WebRequest request, Exception ex) throws Exception {
	NDC.pop();
	if (NDC.getDepth() == 0) {
		NDC.remove();
	}
}
 
Example 2
Source File: Log4jNestedDiagnosticContextInterceptor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the log message from the Log4J NDC when the processing thread is
 * exited after the start of asynchronous request handling.
 */
@Override
public void afterConcurrentHandlingStarted(WebRequest request) {
	NDC.pop();
	if (NDC.getDepth() == 0) {
		NDC.remove();
	}
}
 
Example 3
Source File: Log4jNestedDiagnosticContextFilter.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Removes the log message from the Log4J NDC after the request is processed
 * and logs the after-request message through Log4J.
 */
@Override
protected void afterRequest(HttpServletRequest request, String message) {
	NDC.pop();
	if (NDC.getDepth() == 0) {
		NDC.remove();
	}
	if (log4jLogger.isDebugEnabled()) {
		log4jLogger.debug(message);
	}
}
 
Example 4
Source File: Log4jNestedDiagnosticContextInterceptor.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Removes the log message from the Log4J NDC after the request is processed.
 */
@Override
public void afterCompletion(WebRequest request, Exception ex) throws Exception {
	NDC.pop();
	if (NDC.getDepth() == 0) {
		NDC.remove();
	}
}
 
Example 5
Source File: Log4jNestedDiagnosticContextInterceptor.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Removes the log message from the Log4J NDC when the processing thread is
 * exited after the start of asynchronous request handling.
 */
@Override
public void afterConcurrentHandlingStarted(WebRequest request) {
	NDC.pop();
	if (NDC.getDepth() == 0) {
		NDC.remove();
	}
}
 
Example 6
Source File: Log4jNestedDiagnosticContextFilter.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
/**
 * Removes the log message from the Log4J NDC after the request is processed
 * and logs the after-request message through Log4J.
 */
@Override
protected void afterRequest(HttpServletRequest request, String message) {
	NDC.pop();
	if (NDC.getDepth() == 0) {
		NDC.remove();
	}
	if (log4jLogger.isDebugEnabled()) {
		log4jLogger.debug(message);
	}
}