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(JsonGenerator generator)
Writes the data associated with this marker to the given
JsonGenerator . |
and, toString, toStringSelf, with
add, contains, contains, getName, hasChildren, hasReferences, iterator, remove
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, iterator, spliterator
public static final String DEFERRED_MARKER_NAME
public DeferredLogstashMarker(Supplier<? extends LogstashMarker> logstashMarkerSupplier)
public void writeTo(JsonGenerator generator) throws IOException
LogstashMarker
JsonGenerator
.writeTo
in class LogstashMarker
generator
- 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.Marker
equals
in class LogstashBasicMarker
public int hashCode()
hashCode
in interface org.slf4j.Marker
hashCode
in class LogstashBasicMarker
Copyright © 2020. All rights reserved.