public final class LoggingContext extends 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 and Description |
---|---|
static void |
clear()
Remove all existing context values.
|
static String |
get(String key)
Get the context value by a key.
|
static Map<String,String> |
getMapping()
Get a read-only map with all context values.
|
static void |
put(String key,
Object value)
Put a new context value.
|
static void |
remove(String key)
Remove a context value if existing.
|
public static Map<String,String> getMapping()
public static String get(String key)
key
- Key of mappingnull
public static void put(String key, Object value)
key
- Key of mappingvalue
- New valuepublic static void remove(String key)
key
- Key of mappingpublic static void clear()
Copyright © 2017. All rights reserved.