public class EmptyLogstashMarker extends LogstashMarker
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(com.fasterxml.jackson.core.JsonGenerator generator)
Writes the data associated with this marker to the given
JsonGenerator. |
and, toString, withadd, contains, contains, equals, getName, hasChildren, hashCode, hasReferences, iterator, removeclone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, iterator, spliteratorpublic static final String EMPTY_MARKER_NAME
public void writeTo(com.fasterxml.jackson.core.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 generatorprotected String toStringSelf()
LogstashMarkerSubclasses should override LogstashMarker.toStringSelf() instead of LogstashMarker.toString(),
since LogstashMarker.toString() will automatically include the LogstashMarker.toStringSelf() and references.
toStringSelf in class LogstashMarkerCopyright © 2019. All rights reserved.