Package org.opennms.core.logging
Class Logging
- java.lang.Object
-
- org.opennms.core.logging.Logging
-
public abstract class Logging extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Logging.MDCCloseable
An adapter to restore the MDC context when done.
-
Field Summary
Fields Modifier and Type Field Description static String
PREFIX_KEY
-
Constructor Summary
Constructors Constructor Description Logging()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,String>
getCopyOfContextMap()
static Runnable
preserve(Runnable runnable)
static void
putPrefix(String name)
static void
putThreadContext(String key, String value)
static void
setContextMap(Map<String,String> mdc)
static Logging.MDCCloseable
withContextMapCloseable(Map<String,String> contextMap)
static void
withPrefix(String prefix, Runnable runnable)
static <T> T
withPrefix(String prefix, Callable<T> callable)
static Logging.MDCCloseable
withPrefixCloseable(String prefix)
-
-
-
Field Detail
-
PREFIX_KEY
public static final String PREFIX_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
withPrefix
public static <T> T withPrefix(String prefix, Callable<T> callable) throws Exception
- Throws:
Exception
-
withPrefixCloseable
public static Logging.MDCCloseable withPrefixCloseable(String prefix)
-
withContextMapCloseable
public static Logging.MDCCloseable withContextMapCloseable(Map<String,String> contextMap)
-
putPrefix
public static void putPrefix(String name)
-
-