public final class ThreadContextDataResolver extends Object
ReadOnlyStringMapResolver
Modifier and Type | Method and Description |
---|---|
boolean |
isFlattening()
Indicates if the resolution should be appended to the parent JSON object.
|
boolean |
isResolvable(LogEvent logEvent)
Indicates if the resolver if applicable for the given
value . |
void |
resolve(LogEvent logEvent,
JsonWriter jsonWriter)
Resolves the given
value using the provided JsonWriter . |
void |
resolve(LogEvent logEvent,
JsonWriter jsonWriter,
boolean succeedingEntry)
Resolves the given
value using the provided JsonWriter . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isResolvable
public boolean isFlattening()
TemplateResolver
For instance, ThreadContextDataResolver
, i.e., MDC resolver,
uses this flag to indicate whether the contents should be appended to the
parent JSON object or not.
isFlattening
in interface TemplateResolver<LogEvent>
public boolean isResolvable(LogEvent logEvent)
TemplateResolver
value
.
For instance, the stack trace resolver can be short-circuited using this check if the stack traces are disabled in the layout configuration.
isResolvable
in interface TemplateResolver<LogEvent>
public void resolve(LogEvent logEvent, JsonWriter jsonWriter)
TemplateResolver
value
using the provided JsonWriter
.resolve
in interface TemplateResolver<LogEvent>
public void resolve(LogEvent logEvent, JsonWriter jsonWriter, boolean succeedingEntry)
TemplateResolver
value
using the provided JsonWriter
.resolve
in interface TemplateResolver<LogEvent>
succeedingEntry
- false, if this is the first element in a collection; true, otherwiseCopyright © 1999-2024 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.