Package org.apache.solr.logging
Class MDCLoggingContext
java.lang.Object
org.apache.solr.logging.MDCLoggingContext
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Call this aftersetCore(SolrCore)orsetCoreDescriptor(CoreContainer, CoreDescriptor)in a finally.static Stringstatic Stringstatic voidreset()Resets to a cleared state.static voidsetCollection(String collection) static voidSets multiple information from the params.static voidsetCoreDescriptor(CoreContainer coreContainer, CoreDescriptor cd) Sets multiple information from the params.static voidsetCoreName(String core) static voidstatic voidsetNode(CoreContainer cc) static voidsetReplica(String replica) static voidstatic voidsetTracerId(String traceId)
-
Field Details
-
TRACE_ID
- See Also:
-
-
Constructor Details
-
MDCLoggingContext
public MDCLoggingContext()
-
-
Method Details
-
setCollection
-
setTracerId
-
getTraceId
-
setShard
-
setReplica
-
setCoreName
-
setNode
-
setNode
-
getNodeName
-
setCore
Sets multiple information from the params. REMEMBER TO CALLclear()in a finally! -
setCoreDescriptor
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.
-