public class OddjobNDC extends Object implements LoggingConstants
It is very crude wrapper for the Log4j MDC class. One day it would be nice to work out how to apply this to other logging utilities.
Note that this is a thread based nested diagnostic context that does not interfere with Log4j's own. It populates log4j's mapped diagnostic context instead.
Modifier and Type | Class and Description |
---|---|
static class |
OddjobNDC.LoggerAndJob
Holds Logger and Job information for the Stack.
|
MDC_JOB_NAME, MDC_LOGGER
Modifier and Type | Method and Description |
---|---|
static OddjobNDC.LoggerAndJob |
peek()
Looks at the last diagnostic context at the top of this NDC without
removing it.
|
static OddjobNDC.LoggerAndJob |
pop()
Clients should call this method before leaving a diagnostic context.
|
static void |
push(String loggerName,
Object job)
Push new diagnostic context information for the current thread.
|
public static OddjobNDC.LoggerAndJob pop()
The returned value is the value that was pushed last. If no context is available, then the empty string "" is returned.
public static OddjobNDC.LoggerAndJob peek()
The returned value is the value that was pushed last. If no context is available, then the empty string "" is returned.