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 |
contains(org.slf4j.Marker other) |
boolean |
contains(String name) |
boolean |
equals(Object obj) |
String |
getName() |
boolean |
hasChildren()
Deprecated.
|
int |
hashCode() |
boolean |
hasReferences() |
Iterator<org.slf4j.Marker> |
iterator() |
boolean |
remove(org.slf4j.Marker referenceToRemove) |
void |
writeTo(JsonGenerator generator)
Writes the data associated with this marker to the given
JsonGenerator. |
add, and, toString, toStringSelf, withclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, iterator, spliteratorpublic static final String DEFERRED_MARKER_NAME
public DeferredLogstashMarker(Supplier<? extends LogstashMarker> logstashMarkerSupplier)
public void writeTo(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.Markerpublic int hashCode()
hashCode in interface org.slf4j.Markerpublic String getName()
getName in interface org.slf4j.Markerpublic boolean hasReferences()
hasReferences in interface org.slf4j.Marker@Deprecated public boolean hasChildren()
hasChildren in interface org.slf4j.Markerpublic Iterator<org.slf4j.Marker> iterator()
iterator in interface org.slf4j.Markerpublic boolean remove(org.slf4j.Marker referenceToRemove)
remove in interface org.slf4j.Markerpublic boolean contains(org.slf4j.Marker other)
contains in interface org.slf4j.Markerpublic boolean contains(String name)
contains in interface org.slf4j.MarkerCopyright © 2013–2021. All rights reserved.