Package org.apache.solr.logging
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 callsclear()
. Always callsetCore(SolrCore)
orsetCoreDescriptor(CoreContainer, CoreDescriptor)
and thenclear()
in a finally block.
-
-
Constructor Summary
Constructors Constructor Description MDCLoggingContext()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clear()
Call this aftersetCore(SolrCore)
orsetCoreDescriptor(CoreContainer, CoreDescriptor)
in a finally.static String
getNodeName()
static String
getTraceId()
static void
reset()
Resets to a cleared state.static void
setCollection(String collection)
static void
setCore(SolrCore core)
Sets multiple information from the params.static void
setCoreDescriptor(CoreContainer coreContainer, CoreDescriptor cd)
Sets multiple information from the params.static void
setCoreName(String core)
static void
setNode(String node)
static void
setNode(CoreContainer cc)
static void
setReplica(String replica)
static void
setShard(String shard)
static void
setTracerId(String traceId)
-
-
-
Field Detail
-
TRACE_ID
public static final String TRACE_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 CALLclear()
in a finally!
-
setCoreDescriptor
public static void setCoreDescriptor(CoreContainer coreContainer, CoreDescriptor cd)
Sets multiple information from the params. REMEMBER TO CALLclear()
in a finally!
-
clear
public static void clear()
Call this aftersetCore(SolrCore)
orsetCoreDescriptor(CoreContainer, CoreDescriptor)
in a finally.
-
reset
public static void reset()
Resets to a cleared state. Used in-between requests into Solr.
-
-