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 |
|---|---|
| private final ThreadLocalMapOfStacks | |
| pack-priv final ThreadLocal |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | clearDequeByKey(String
identifies the stack key)Implements org. |
| private Map | |
| 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. key parameter.
|
| public void | setContextMap(Map<String, String>
the new map contextMap)Implements org. |
| threadLocalMapOfDeques | back to summary |
|---|---|
| private final ThreadLocalMapOfStacks threadLocalMapOfDeques | |
| threadLocalUnmodifiableMap | back to summary |
|---|---|
| pack-priv final ThreadLocal<Map<String, String>> threadLocalUnmodifiableMap | |
| LogbackMDCAdapterSimple | back to summary |
|---|---|
| public LogbackMDCAdapterSimple() | |
| 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'. | |
| duplicateMap | back to summary |
|---|---|
| private Map | |
| get | back to summary |
|---|---|
| public String get(String key) Implements org. Get the context identified by the
| |
| 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. | |
| makeUnmodifiableAndThreadLocalSet | back to summary |
|---|---|
| private void makeUnmodifiableAndThreadLocalSet(Map<String, String> aMap) | |
| 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.
| |
| 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<String, String> contextMap) Implements org. Set the MDC map to the map passed as parameter. | |