public class EmptyLogstashMarker extends LogstashMarker implements StructuredArgument
LogstashMarker.and(Marker)
.
For example:
LogstashMarker marker = Markers.empty(); if (condition1) { marker = marker.and(Markers.append("fieldName1", value1); } if (condition2) { marker = marker.and(Markers.append("fieldName2", value2); }
Modifier and Type | Field and Description |
---|---|
static String |
EMPTY_MARKER_NAME |
MARKER_NAME_PREFIX
Constructor and Description |
---|
EmptyLogstashMarker() |
Modifier and Type | Method and Description |
---|---|
protected String |
toStringSelf()
Returns a string representation of this object, without including any references.
|
void |
writeTo(JsonGenerator generator)
Writes the data associated with this marker to the given
JsonGenerator . |
and, toString, with
add, contains, contains, equals, getName, hasChildren, hashCode, hasReferences, iterator, remove
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
toString
forEach, iterator, spliterator
public static final String EMPTY_MARKER_NAME
public void writeTo(JsonGenerator generator) throws IOException
LogstashMarker
JsonGenerator
.writeTo
in interface StructuredArgument
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 generatorprotected String toStringSelf()
LogstashMarker
Subclasses should override LogstashMarker.toStringSelf()
instead of LogstashMarker.toString()
,
since LogstashMarker.toString()
will automatically include the LogstashMarker.toStringSelf()
and references.
toStringSelf
in class LogstashMarker
Copyright © 2020. All rights reserved.