Class Logging


  • public abstract class Logging
    extends java.lang.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 java.lang.String PREFIX_KEY  
    • Constructor Summary

      Constructors 
      Constructor Description
      Logging()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.Map<java.lang.String,​java.lang.String> getCopyOfContextMap()  
      static java.lang.Runnable preserve​(java.lang.Runnable runnable)  
      static void putPrefix​(java.lang.String name)  
      static void putThreadContext​(java.lang.String key, java.lang.String value)  
      static void setContextMap​(java.util.Map<java.lang.String,​java.lang.String> mdc)  
      static Logging.MDCCloseable withContextMapCloseable​(java.util.Map<java.lang.String,​java.lang.String> contextMap)  
      static void withPrefix​(java.lang.String prefix, java.lang.Runnable runnable)  
      static <T> T withPrefix​(java.lang.String prefix, java.util.concurrent.Callable<T> callable)  
      static Logging.MDCCloseable withPrefixCloseable​(java.lang.String prefix)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Logging

        public Logging()
    • Method Detail

      • withPrefix

        public static <T> T withPrefix​(java.lang.String prefix,
                                       java.util.concurrent.Callable<T> callable)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • putThreadContext

        public static void putThreadContext​(java.lang.String key,
                                            java.lang.String value)
      • getCopyOfContextMap

        public static java.util.Map<java.lang.String,​java.lang.String> getCopyOfContextMap()
      • setContextMap

        public static void setContextMap​(java.util.Map<java.lang.String,​java.lang.String> mdc)
      • withPrefix

        public static void withPrefix​(java.lang.String prefix,
                                      java.lang.Runnable runnable)
      • withPrefixCloseable

        public static Logging.MDCCloseable withPrefixCloseable​(java.lang.String prefix)
      • withContextMapCloseable

        public static Logging.MDCCloseable withContextMapCloseable​(java.util.Map<java.lang.String,​java.lang.String> contextMap)
      • preserve

        public static java.lang.Runnable preserve​(java.lang.Runnable runnable)
      • putPrefix

        public static void putPrefix​(java.lang.String name)