public class LogstashLoggingEventEnhancer extends Object implements LoggingEventEnhancer, JsonLoggingEventEnhancer
Supported Markers: - ObjectAppendingMarker: key-value pairs are added to the log entries.
This can be used by specifying this class in a <loggingEventEnhancer>
element for your
LoggingAppender
or
StackdriverJsonLayout
definitions in logback.xml.
Constructor and Description |
---|
LogstashLoggingEventEnhancer() |
Modifier and Type | Method and Description |
---|---|
void |
enhanceJsonLogEntry(Map<String,Object> jsonMap,
ch.qos.logback.classic.spi.ILoggingEvent event)
Add additional JSON data to the JSON log entry, based on the
ILoggingEvent . |
void |
enhanceLogEntry(LogEntry.Builder builder,
ch.qos.logback.classic.spi.ILoggingEvent event) |
public void enhanceLogEntry(LogEntry.Builder builder, ch.qos.logback.classic.spi.ILoggingEvent event)
enhanceLogEntry
in interface LoggingEventEnhancer
public void enhanceJsonLogEntry(Map<String,Object> jsonMap, ch.qos.logback.classic.spi.ILoggingEvent event)
JsonLoggingEventEnhancer
ILoggingEvent
.
Users should put additional records to jsonMap
to extend the JSON object that will be logged.enhanceJsonLogEntry
in interface JsonLoggingEventEnhancer
jsonMap
- represents the JSON object that is produced by the Stackdriver JSON logging layoutevent
- the Logback logging eventCopyright © 2021. All rights reserved.