Class NDC

java.lang.Object
org.jboss.logging.NDC

public final class NDC extends Object
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    NDC()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Clears the nested diagnostics context.
    static String
    get()
    Retrieves the current values set for the nested diagnostics context.
    static int
    The current depth of the nested diagnostics context.
    static String
    Peeks at the top value from the stack and returns it.
    static String
    pop()
    Pops top value from the stack and returns it.
    static void
    push(String message)
    Pushes a value to the nested diagnostics context stack.
    static void
    setMaxDepth(int maxDepth)
    Sets maximum depth of the stack removing any entries below the maximum depth.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NDC

      private NDC()
  • Method Details

    • clear

      public static void clear()
      Clears the nested diagnostics context.
    • get

      public static String get()
      Retrieves the current values set for the nested diagnostics context.
      Returns:
      the current value set or null if 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

      public static String 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

      public static String peek()
      Peeks at the top value from the stack and returns it.
      Returns:
      the value or an empty string
    • push

      public static void push(String message)
      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