The MDC is managed on a per thread basis. Note that a child thread does not inherit the mapped diagnostic context of its parent.
For more information about MDC, please refer to the online manual at http://logback.qos.ch/manual/mdc.html
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final ThreadLocal | |
| pack-priv final ThreadLocal | |
| private final ThreadLocalMapOfStacks |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | clearDequeByKey(String
identifies the stack key)Implements org. |
| public String | get(String key)
Implements org. key parameter.
|
| public Map | getCopyOfContextMap()
Implements org. |
| public Deque | getCopyOfDequeByKey(String
identifies the stack key)Implements org. |
| public Set | |
| public Map | |
| private void | |
| public String | popByKey(String
identifies the deque(stack) key)Implements org. |
| public void | pushByKey(String
identifies the appropriate stack key, String the value to push into the stack value)Implements org. |
| public void | put(String key, String val)
Implements org. val parameter) as identified with the
key parameter into the current thread's context map.
|
| public void | remove(String key)
Implements org. Remove the context identified by the |
| public void | setContextMap(Map<K, V>
must contain only keys and values of type String contextMap)Implements org. |
| readOnlyThreadLocalMap | back to summary |
|---|---|
| pack-priv final ThreadLocal<Map<String, String>> readOnlyThreadLocalMap | |
| readWriteThreadLocalMap | back to summary |
|---|---|
| pack-priv final ThreadLocal<Map<String, String>> readWriteThreadLocalMap | |
| threadLocalMapOfDeques | back to summary |
|---|---|
| private final ThreadLocalMapOfStacks threadLocalMapOfDeques | |
| LogbackMDCAdapter | back to summary |
|---|---|
| public LogbackMDCAdapter() | |
| clear | back to summary |
|---|---|
| public void clear() Implements org. Clear all entries in the MDC.
| |
| clearDequeByKey | back to summary |
|---|---|
| public void clearDequeByKey(String key) Implements org. Doc from org. Clear the deque(stack) referenced by 'key'. | |
| get | back to summary |
|---|---|
| public String get(String key) Implements org. Get the context identified by the
This method has no side effects.
| |
| getCopyOfContextMap | back to summary |
|---|---|
| public Map Implements org. Return a copy of the current thread's context map. Returned value may be null.
| |
| getCopyOfDequeByKey | back to summary |
|---|---|
| public Deque Implements org. Doc from org. Returns a copy of the deque(stack) referenced by 'key'. May be null. | |
| getKeys | back to summary |
|---|---|
| public Set Returns the keys in the MDC as a | |
| getPropertyMap | back to summary |
|---|---|
| public Map Get the current thread's MDC as a map. This method is intended to be used internally. The returned map is unmodifiable (since version 1.3.2/1.4.2).
| |
| nullifyReadOnlyThreadLocalMap | back to summary |
|---|---|
| private void nullifyReadOnlyThreadLocalMap() | |
| popByKey | back to summary |
|---|---|
| public String popByKey(String key) Implements org. Doc from org. Pop the stack referenced by 'key' and return the value possibly null. | |
| pushByKey | back to summary |
|---|---|
| public void pushByKey(String key, String value) Implements org. Doc from org. Push a value into the deque(stack) referenced by 'key'. | |
| put | back to summary |
|---|---|
| public void put(String key, String val) throws IllegalArgumentException Implements org. Put a context value (the
If the current thread does not have a context map it is created as a side effect of this call.
Each time a value is added, a new instance of the map is created. This is to be certain that the serialization process will operate on the updated map and not send a reference to the old map, thus not allowing the remote logback component to see the latest changes.
| |
| remove | back to summary |
|---|---|
| public void remove(String key) Implements org. Remove the context identified by the
| |
| setContextMap | back to summary |
|---|---|
| public void setContextMap(Map<K, V> contextMap) Implements org. Doc from org. Set the current thread's context map by first clearing any existing map and then copying the map passed as parameter. The context map parameter must only contain keys and values of type String. Implementations must support null valued map passed as parameter.
| |