public class LoggingContext extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
LoggingContext.PreviousContext
A snapshot of an MDC context that can be
LoggingContext.PreviousContext.restore(). |
| Modifier and Type | Field and Description |
|---|---|
static String |
CONNECTOR_CONTEXT
The key for the connector context name MDC property.
|
static String |
CONNECTOR_NAME
The key for the connector logical name MDC property.
|
static String |
CONNECTOR_TYPE
The key for the connector type MDC property.
|
| Modifier | Constructor and Description |
|---|---|
private |
LoggingContext() |
| Modifier and Type | Method and Description |
|---|---|
static LoggingContext.PreviousContext |
forConnector(String connectorType,
String connectorName,
String contextName)
Configure for a connector the logger's Mapped Diagnostic Context (MDC) properties for the thread making this call.
|
static void |
temporarilyForConnector(String connectorType,
String connectorName,
String contextName,
Runnable operation)
Run the supplied function in the temporary connector MDC context, and when complete always return the MDC context to its
state before this method was called.
|
public static final String CONNECTOR_TYPE
public static final String CONNECTOR_NAME
public static final String CONNECTOR_CONTEXT
public static LoggingContext.PreviousContext forConnector(String connectorType, String connectorName, String contextName)
connectorType - the type of connector; may not be nullconnectorName - the name of the connector; may not be nullcontextName - the name of the context; may not be nullIllegalArgumentException - if any of the parameters are nullpublic static void temporarilyForConnector(String connectorType, String connectorName, String contextName, Runnable operation)
connectorType - the type of connector; may not be nullconnectorName - the logical name of the connector; may not be nullcontextName - the name of the context; may not be nulloperation - the function to run in the new MDC context; may not be nullIllegalArgumentException - if any of the parameters are nullCopyright © 2021 JBoss by Red Hat. All rights reserved.