Package com.persequor.extension.logging
Class AdditionalLoggingData
java.lang.Object
com.persequor.extension.logging.AdditionalLoggingData
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the context map.getContextValue
(String key) Gets the value of a key in the context map.boolean
hasContext
(String key) Checks if the context map contains a key.void
putContext
(String key, String value) Puts a key-value pair into the context map.
-
Constructor Details
-
AdditionalLoggingData
public AdditionalLoggingData()
-
-
Method Details
-
putContext
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 keyvalue
- The value
-
getContextMap
Gets the context map.- Returns:
- An unmodifiable copy of the context map
-
hasContext
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
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
-