public final class LoggingUtils
extends java.lang.Object
Logging| Modifier and Type | Method and Description |
|---|---|
static void |
appendKey(java.lang.String key,
java.lang.String value)
Appends an additional key and value to each log entry made.
|
static void |
appendKeys(java.util.Map<java.lang.String,java.lang.String> customKeys)
Appends additional key and value to each log entry made.
|
static void |
defaultObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
Sets the instance of ObjectMapper object which is used for serialising event when
@Logging(logEvent = true). |
static com.fasterxml.jackson.databind.ObjectMapper |
objectMapper() |
static void |
removeKey(java.lang.String customKey)
Remove an additional key from log entry.
|
static void |
removeKeys(java.lang.String... keys)
Removes additional keys from log entry.
|
static void |
setCorrelationId(java.lang.String value)
Sets correlation id attribute on the logs.
|
public static void appendKey(java.lang.String key,
java.lang.String value)
key - The name of the key to be loggedvalue - The value to be loggedpublic static void appendKeys(java.util.Map<java.lang.String,java.lang.String> customKeys)
customKeys - Map of custom keys values to be appended to logspublic static void removeKey(java.lang.String customKey)
customKey - The name of the key to be loggedpublic static void removeKeys(java.lang.String... keys)
keys - Map of custom keys values to be appended to logspublic static void setCorrelationId(java.lang.String value)
value - The value of the correlation idpublic static void defaultObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
@Logging(logEvent = true).objectMapper - Custom implementation of object mapper to be used for logging serialised eventpublic static com.fasterxml.jackson.databind.ObjectMapper objectMapper()
Copyright © 2021. All rights reserved.