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 classLogging.MDCCloseableAn adapter to restore the MDC context when done.
-
Field Summary
Fields Modifier and Type Field Description static StringPREFIX_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 Runnablepreserve(Runnable runnable)static voidputPrefix(String name)static voidputThreadContext(String key, String value)static voidsetContextMap(Map<String,String> mdc)static Logging.MDCCloseablewithContextMapCloseable(Map<String,String> contextMap)static voidwithPrefix(String prefix, Runnable runnable)static <T> TwithPrefix(String prefix, Callable<T> callable)static Logging.MDCCloseablewithPrefixCloseable(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)
-
-