public abstract class LogstashMarker extends LogstashBasicMarker
Marker
that is known and understood by the logstash logback encoder.
In particular these markers are used to write data into the logstash json event via writeTo(JsonGenerator)
.
Modifier and Type | Field and Description |
---|---|
static String |
MARKER_NAME_PREFIX |
Constructor and Description |
---|
LogstashMarker(String name) |
Modifier and Type | Method and Description |
---|---|
<T extends LogstashMarker> |
and(org.slf4j.Marker reference)
Adds the given marker as a reference, and returns this marker.
|
<T extends LogstashMarker> |
with(org.slf4j.Marker reference)
Deprecated.
Use
and(Marker) instead |
abstract void |
writeTo(com.fasterxml.jackson.core.JsonGenerator generator)
Writes the data associated with this marker to the given
JsonGenerator . |
add, contains, contains, equals, getName, hasChildren, hashCode, hasReferences, iterator, remove, toString
public static final String MARKER_NAME_PREFIX
public LogstashMarker(String name)
public <T extends LogstashMarker> T and(org.slf4j.Marker reference)
This can be used to chain markers together fluently on a log line. For example:
import static net.logstash.logback.marker.Markers.*
logger.info(append("name1", "value1).and(append("name2", "value2")), "log message");
@Deprecated public <T extends LogstashMarker> T with(org.slf4j.Marker reference)
and(Marker)
insteadand(Marker)
public abstract void writeTo(com.fasterxml.jackson.core.JsonGenerator generator) throws IOException
JsonGenerator
.IOException
Copyright © 2018. All rights reserved.