-
- All Implemented Interfaces:
public class LogContextMaintains a map of key-value pairs (both Strings) which holds arbitrary context to use as a prefix for log messages. Sub-contexts can be created and will inherit any context values from their ancestors' context.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringCONTEXT_START_TOKENpublic final static StringCONTEXT_END_TOKEN
-
Constructor Summary
Constructors Constructor Description LogContext()LogContext(Map<String, String> context)
-
Method Summary
Modifier and Type Method Description synchronized LogContextcreateSubContext(Map<String, String> childContextData)voidaddContext(String key, String value)synchronized voidaddContext(Map<String, String> addedContext)StringtoString()-
-
Method Detail
-
createSubContext
synchronized LogContext createSubContext(Map<String, String> childContextData)
-
addContext
void addContext(String key, String value)
-
addContext
synchronized void addContext(Map<String, String> addedContext)
-
-
-
-