Class MDCLoggingContext

java.lang.Object
org.apache.solr.logging.MDCLoggingContext

public class MDCLoggingContext extends Object
Set's per thread context info for logging. Nested calls will use the top level parent for all context. The first caller always owns the context until it calls clear(). Always call setCore(SolrCore) or setCoreDescriptor(CoreContainer, CoreDescriptor) and then clear() in a finally block.
  • Field Details

  • Constructor Details

    • MDCLoggingContext

      public MDCLoggingContext()
  • Method Details

    • setCollection

      public static void setCollection(String collection)
    • setTracerId

      public static void setTracerId(String traceId)
    • getTraceId

      public static String getTraceId()
    • setShard

      public static void setShard(String shard)
    • setReplica

      public static void setReplica(String replica)
    • setCoreName

      public static void setCoreName(String core)
    • setNode

      public static void setNode(CoreContainer cc)
    • setNode

      public static void setNode(String node)
    • getNodeName

      public static String getNodeName()
    • setCore

      public static void setCore(SolrCore core)
      Sets multiple information from the params. REMEMBER TO CALL clear() in a finally!
    • setCoreDescriptor

      public static void setCoreDescriptor(CoreContainer coreContainer, CoreDescriptor cd)
      Sets multiple information from the params. REMEMBER TO CALL clear() in a finally!
    • clear

      public static void clear()
    • reset

      public static void reset()
      Resets to a cleared state. Used in-between requests into Solr.