Class AdditionalLoggingData

java.lang.Object
com.persequor.extension.logging.AdditionalLoggingData

public class AdditionalLoggingData extends Object
Carrier for additional logging data that can be attached to a log message.

This class exists so that the amount of logging method combinations can be kept to a minimum.

  • Constructor Details

    • AdditionalLoggingData

      public AdditionalLoggingData()
  • Method Details

    • putContext

      public void putContext(String key, String value)
      Puts a key-value pair into the context map.

      Context map is passed to the logger implementation and can be used to attach additional data to the log message.

      Parameters:
      key - The key
      value - The value
    • getContextMap

      public Map<String,String> getContextMap()
      Gets the context map.
      Returns:
      An unmodifiable copy of the context map
    • hasContext

      public boolean hasContext(String key)
      Checks if the context map contains a key.
      Parameters:
      key - The key
      Returns:
      True if the key is present in the context map, false otherwise
    • getContextValue

      public String getContextValue(String key)
      Gets the value of a key in the context map.
      Parameters:
      key - The key
      Returns:
      The value of the key, or null if the key is not present