public final class NDC
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
NDC.Holder |
private static class |
NDC.Stack<T> |
Modifier and Type | Field and Description |
---|---|
private static NDC.Holder |
ndc |
Modifier | Constructor and Description |
---|---|
private |
NDC() |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clear the thread's NDC stack.
|
static java.lang.String |
get()
Get the current NDC value.
|
static java.lang.String |
get(int n)
Provided for compatibility with log4j.
|
static int |
getDepth()
Get the current NDC stack depth.
|
static java.lang.String |
pop()
Pop the topmost value from the NDC stack and return it.
|
static int |
push(java.lang.String context)
Push a value on to the NDC stack, returning the new stack depth which should later be used to restore the stack.
|
static void |
trimTo(int size)
Trim the thread NDC stack down to no larger than the given size.
|
private static final NDC.Holder ndc
public static int push(java.lang.String context)
context
- the new valuepublic static java.lang.String pop()
public static void clear()
public static void trimTo(int size)
push()
.size
- the new sizepublic static int getDepth()
public static java.lang.String get()
""
if there is nonepublic static java.lang.String get(int n)
n
entries from the bottom.n
- the indexnull
if there is none