Class RawJsonAppendingMarker
java.lang.Object
net.logstash.logback.marker.LogstashMarker
net.logstash.logback.marker.SingleFieldAppendingMarker
net.logstash.logback.marker.RawJsonAppendingMarker
- All Implemented Interfaces:
Serializable, Iterable<org.slf4j.Marker>, StructuredArgument, org.slf4j.Marker
A
Marker OR StructuredArgument that
writes a raw json value to the logstash json event
under a given field name.
When writing to the JSON data (via ArgumentsJsonProvider or LogstashMarkersJsonProvider),
the raw string is written verbatim without any modifications,
but assuming it must constitute a single legal JSON value (number, string, boolean, null, Array or List)
When writing to a String (when used as a StructuredArgument to the event's formatted message),
the raw string is written as the field value.
Note that using RawJsonAppendingMarker as a StructuredArgument is not very common.
- See Also:
-
Field Summary
FieldsFields inherited from class SingleFieldAppendingMarker
MARKER_NAME_PREFIXFields inherited from interface org.slf4j.Marker
ANY_MARKER, ANY_NON_NULL_MARKER -
Constructor Summary
ConstructorsConstructorDescriptionRawJsonAppendingMarker(String fieldName, String rawJson) RawJsonAppendingMarker(String fieldName, String rawJson, String messageFormatPattern) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancontains(org.slf4j.Marker other) booleanprotected ObjectReturn the value that should be included in the output ofLogstashMarker.toString().getName()booleanDeprecated.inthashCode()booleanIterator<org.slf4j.Marker> iterator()booleanremove(org.slf4j.Marker referenceToRemove) protected voidwriteFieldValue(JsonGenerator generator) Writes the field value to the generator.Methods inherited from class SingleFieldAppendingMarker
getFieldName, toStringSelf, writeFieldName, writeToMethods inherited from class LogstashMarker
add, and, toString, withMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface StructuredArgument
toString
-
Field Details
-
MARKER_NAME
- See Also:
-
-
Constructor Details
-
RawJsonAppendingMarker
-
RawJsonAppendingMarker
-
-
Method Details
-
writeFieldValue
Description copied from class:SingleFieldAppendingMarkerWrites the field value to the generator.- Specified by:
writeFieldValuein classSingleFieldAppendingMarker- Parameters:
generator- the generator to write JSON
-
getFieldValue
Description copied from class:SingleFieldAppendingMarkerReturn the value that should be included in the output ofLogstashMarker.toString().- Specified by:
getFieldValuein classSingleFieldAppendingMarker- Returns:
- the field value
-
equals
- Specified by:
equalsin interfaceorg.slf4j.Marker- Overrides:
equalsin classSingleFieldAppendingMarker
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceorg.slf4j.Marker- Overrides:
hashCodein classSingleFieldAppendingMarker
-
getName
- Specified by:
getNamein interfaceorg.slf4j.Marker
-
hasReferences
public boolean hasReferences()- Specified by:
hasReferencesin interfaceorg.slf4j.Marker
-
hasChildren
Deprecated.- Specified by:
hasChildrenin interfaceorg.slf4j.Marker
-
iterator
- Specified by:
iteratorin interfaceorg.slf4j.Marker
-
remove
public boolean remove(org.slf4j.Marker referenceToRemove) - Specified by:
removein interfaceorg.slf4j.Marker
-
contains
public boolean contains(org.slf4j.Marker other) - Specified by:
containsin interfaceorg.slf4j.Marker
-
contains
- Specified by:
containsin interfaceorg.slf4j.Marker
-