Interface LoggingContextHandler

All Known Implementing Classes:
NOPLoggingContextHandler, PassThroughMDCLoggingContextHandler

public interface LoggingContextHandler
  • Method Details

    • put

      void put(String key, String val)
      Put a value into the current context map.
      Parameters:
      key - - The key to put
      val - - The value to put associated with key
    • putCloseable

      Closeable putCloseable(String key, String val)
      Put a value into the current context map. This method return a Closeable object who can remove key when close is called.
      Parameters:
      key - - The key to put
      val - - The value to put associated with key
      Returns:
      a Closeable who can remove key when close is called
    • get

      String get(String key)
      Gets the context value identified by the key parameter
      Parameters:
      key - - The key to locate
      Returns:
      The value associated with the key
    • remove

      void remove(String key)
      Removes the context value identified by key parameter
      Parameters:
      key - - The key to remove
    • clear

      void clear()
      Remove all values from the context
    • getCopyOfContextMap

      Map<String,String> getCopyOfContextMap()
      Gets an copy of this current context map
      Returns:
      copy of the context.
    • setContextMap

      void setContextMap(Map<String,String> contextMap)
      Sets current context map to the map passed as parameter.
      Parameters:
      contextMap - the context map to use.