Package net.logstash.logback.marker
Class DeferredLogstashMarker
java.lang.Object
net.logstash.logback.marker.LogstashMarker
net.logstash.logback.marker.DeferredLogstashMarker
- All Implemented Interfaces:
Serializable
,Iterable<org.slf4j.Marker>
,org.slf4j.Marker
A
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.
- See Also:
-
Field Summary
FieldsFields inherited from class net.logstash.logback.marker.LogstashMarker
MARKER_NAME_PREFIX
Fields inherited from interface org.slf4j.Marker
ANY_MARKER, ANY_NON_NULL_MARKER
-
Constructor Summary
ConstructorsConstructorDescriptionDeferredLogstashMarker
(Supplier<? extends LogstashMarker> logstashMarkerSupplier) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
contains
(org.slf4j.Marker other) boolean
getName()
boolean
Deprecated.int
hashCode()
boolean
Iterator<org.slf4j.Marker>
iterator()
boolean
remove
(org.slf4j.Marker referenceToRemove) void
writeTo
(JsonGenerator generator) Writes the data associated with this marker to the givenJsonGenerator
.Methods inherited from class net.logstash.logback.marker.LogstashMarker
add, and, toString, toStringSelf, with
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Field Details
-
DEFERRED_MARKER_NAME
- See Also:
-
-
Constructor Details
-
DeferredLogstashMarker
-
-
Method Details
-
writeTo
Description copied from class:LogstashMarker
Writes the data associated with this marker to the givenJsonGenerator
.- Specified by:
writeTo
in classLogstashMarker
- Parameters:
generator
- the generator to which to write the output of this marker.- Throws:
IOException
- if there was an error writing to the generator
-
equals
- Specified by:
equals
in interfaceorg.slf4j.Marker
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceorg.slf4j.Marker
-
getName
- Specified by:
getName
in interfaceorg.slf4j.Marker
-
hasReferences
public boolean hasReferences()- Specified by:
hasReferences
in interfaceorg.slf4j.Marker
-
hasChildren
Deprecated.- Specified by:
hasChildren
in interfaceorg.slf4j.Marker
-
iterator
- Specified by:
iterator
in interfaceorg.slf4j.Marker
-
remove
public boolean remove(org.slf4j.Marker referenceToRemove) - Specified by:
remove
in interfaceorg.slf4j.Marker
-
contains
public boolean contains(org.slf4j.Marker other) - Specified by:
contains
in interfaceorg.slf4j.Marker
-
contains
- Specified by:
contains
in interfaceorg.slf4j.Marker
-