Module logstash.logback.encoder
Interface MdcEntryWriter
- All Known Implementing Classes:
BooleanMdcEntryWriter,DoubleMdcEntryWriter,LongMdcEntryWriter,RegexFilteringMdcEntryWriter
public interface MdcEntryWriter
Writes an entry from the
MDC to the JsonGenerator.
Implementations can convert the value as appropriate,
or chose to not write anything for the entry.-
Method Summary
Modifier and TypeMethodDescriptionbooleanwriteMdcEntry(JsonGenerator generator, String fieldName, String mdcKey, String mdcValue) Writes the given MDC entry allowing to manipulate the output of the field name and field value.
-
Method Details
-
writeMdcEntry
boolean writeMdcEntry(JsonGenerator generator, String fieldName, String mdcKey, String mdcValue) throws IOException Writes the given MDC entry allowing to manipulate the output of the field name and field value.- Parameters:
generator- the generator to write the entry to.fieldName- the field name to use when writing the entry.mdcKey- the key of the MDC map entry.mdcValue- the value of the MDC map entry.- Returns:
- true if this
MdcEntryWriterhandled the output of the entry, otherwise return false. - Throws:
IOException
-