public class DeferredLogstashMarker extends LogstashMarker
LogstashMarker that defers the creation of another LogstashMarker until
the first time it is encoded.
Encoding (and therefore the deferred marker creation) can potentially take place
on another thread if an async appender (e.g. AsyncAppender or AsyncDisruptorAppender) is used.
The deferred value will only be calculated once. The single value supplied by the supplier will be reused every time the marker is written. For example, if multiple appenders use a logstash encoder, the supplier will be invoked when the first appender encodes the marker. That same supplied value will be used when the next appender encodes the marker.
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFERRED_MARKER_NAME |
MARKER_NAME_PREFIX| Constructor and Description |
|---|
DeferredLogstashMarker(Supplier<? extends LogstashMarker> logstashMarkerSupplier) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
void |
writeTo(com.fasterxml.jackson.core.JsonGenerator generator)
Writes the data associated with this marker to the given
JsonGenerator. |
and, toString, toStringSelf, withadd, contains, contains, getName, hasChildren, hasReferences, iterator, removeclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, iterator, spliteratorpublic static final String DEFERRED_MARKER_NAME
public DeferredLogstashMarker(Supplier<? extends LogstashMarker> logstashMarkerSupplier)
public void writeTo(com.fasterxml.jackson.core.JsonGenerator generator)
throws IOException
LogstashMarkerJsonGenerator.writeTo in class LogstashMarkergenerator - the generator to which to write the output of this marker.IOException - if there was an error writing to the generatorpublic boolean equals(Object obj)
equals in interface org.slf4j.Markerequals in class LogstashBasicMarkerpublic int hashCode()
hashCode in interface org.slf4j.MarkerhashCode in class LogstashBasicMarkerCopyright © 2019. All rights reserved.