public final class LoggingContext
extends java.lang.Object
If logging context is used in a thread from a thread pool, clear() should be called before putting the
thread back to the pool.
| Modifier and Type | Method | Description |
|---|---|---|
static void |
clear() |
Remove all existing context values.
|
static java.lang.String |
get(java.lang.String key) |
Get the context value by a key.
|
static java.util.Map<java.lang.String,java.lang.String> |
getMapping() |
Get a read-only map with all context values.
|
static void |
put(java.lang.String key,
java.lang.Object value) |
Put a new context value.
|
static void |
remove(java.lang.String key) |
Remove a context value if existing.
|
public static java.util.Map<java.lang.String,java.lang.String> getMapping()
public static java.lang.String get(java.lang.String key)
key - Key of mappingnullpublic static void put(java.lang.String key,
java.lang.Object value)
key - Key of mappingvalue - New valuepublic static void remove(java.lang.String key)
key - Key of mappingpublic static void clear()
Copyright © 2017. All rights reserved.