Class NDC
java.lang.Object
org.jboss.logging.NDC
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clears the nested diagnostics context.static Stringget()Retrieves the current values set for the nested diagnostics context.static intgetDepth()The current depth of the nested diagnostics context.static Stringpeek()Peeks at the top value from the stack and returns it.static Stringpop()Pops top value from the stack and returns it.static voidPushes a value to the nested diagnostics context stack.static voidsetMaxDepth(int maxDepth) Sets maximum depth of the stack removing any entries below the maximum depth.
-
Method Details
-
clear
public static void clear()Clears the nested diagnostics context. -
get
Retrieves the current values set for the nested diagnostics context.- Returns:
- the current value set or
nullif no value was set
-
getDepth
public static int getDepth()The current depth of the nested diagnostics context.- Returns:
- the current depth of the stack
-
pop
Pops top value from the stack and returns it.- Returns:
- the top value from the stack or an empty string if no value was set
-
peek
Peeks at the top value from the stack and returns it.- Returns:
- the value or an empty string
-
push
Pushes a value to the nested diagnostics context stack.- Parameters:
message- the message to push
-
setMaxDepth
public static void setMaxDepth(int maxDepth) Sets maximum depth of the stack removing any entries below the maximum depth.- Parameters:
maxDepth- the maximum depth to set
-