Package de.espirit.common.base
Interface MappedDiagnosticContext
This class hides and serves as a substitute for the underlying logging system's MDC (mapped diagnostic context)
implementation.
- Since:
- 4.1.46
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearMDC()
Clear all entries in the MDC of the underlying implementation.@Nullable String
Get the context identified by the key parameter.iterator()
A read only iterator delivering all key-value-pairs.void
Put a context value (the val parameter) as identified with the key parameter into the current thread's context map.void
Remove the the context identified by the key parameter.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
putMDC
Put a context value (the val parameter) as identified with the key parameter into the current thread's context map. The key parameter cannot be null. The val parameter can be null only if the underlying implementation supports it.- Parameters:
key
- Key to put for.val
- Value to put.- Since:
- 4.1.46
-
getMDC
Get the context identified by the key parameter.- Parameters:
key
- Key to query.- Returns:
- the mapped value or
null
- Since:
- 4.1.46
-
removeMDC
Remove the the context identified by the key parameter.- Parameters:
key
- Key to remove- Since:
- 4.1.46
-
clearMDC
void clearMDC()Clear all entries in the MDC of the underlying implementation.- Since:
- 4.1.46
-
iterator
A read only iterator delivering all key-value-pairs.
-