Class EventJsonLayout
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.LayoutBase<E>
-
- io.dropwizard.logging.json.layout.AbstractJsonLayout<ch.qos.logback.classic.spi.ILoggingEvent>
-
- io.dropwizard.logging.json.layout.EventJsonLayout
-
- All Implemented Interfaces:
ch.qos.logback.core.Layout<ch.qos.logback.classic.spi.ILoggingEvent>,ch.qos.logback.core.spi.ContextAware,ch.qos.logback.core.spi.LifeCycle
public class EventJsonLayout extends AbstractJsonLayout<ch.qos.logback.classic.spi.ILoggingEvent>
Builds JSON messages from logging events of the typeILoggingEvent.
-
-
Constructor Summary
Constructors Constructor Description EventJsonLayout(JsonFormatter jsonFormatter, TimestampFormatter timestampFormatter, ch.qos.logback.classic.pattern.ThrowableHandlingConverter throwableProxyConverter, Set<EventAttribute> includes, Map<String,String> customFieldNames, Map<String,Object> additionalFields, Set<String> includesMdcKeys, boolean flattenMdc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<EventAttribute>getIncludes()Set<String>getIncludesMdcKeys()@Nullable StringgetJsonProtocolVersion()voidsetIncludes(Set<EventAttribute> includes)voidsetIncludesMdcKeys(Set<String> includesMdcKeys)voidsetJsonProtocolVersion(@Nullable String jsonProtocolVersion)voidstart()voidstop()protected Map<String,Object>toJsonMap(ch.qos.logback.classic.spi.ILoggingEvent event)Converts the provided logging event to a genericMap-
Methods inherited from class io.dropwizard.logging.json.layout.AbstractJsonLayout
doLayout
-
Methods inherited from class ch.qos.logback.core.LayoutBase
getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager
-
-
-
-
Constructor Detail
-
EventJsonLayout
public EventJsonLayout(JsonFormatter jsonFormatter, TimestampFormatter timestampFormatter, ch.qos.logback.classic.pattern.ThrowableHandlingConverter throwableProxyConverter, Set<EventAttribute> includes, Map<String,String> customFieldNames, Map<String,Object> additionalFields, Set<String> includesMdcKeys, boolean flattenMdc)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfacech.qos.logback.core.spi.LifeCycle- Overrides:
startin classch.qos.logback.core.LayoutBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
stop
public void stop()
- Specified by:
stopin interfacech.qos.logback.core.spi.LifeCycle- Overrides:
stopin classch.qos.logback.core.LayoutBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
toJsonMap
protected Map<String,Object> toJsonMap(ch.qos.logback.classic.spi.ILoggingEvent event)
Description copied from class:AbstractJsonLayoutConverts the provided logging event to a genericMap- Specified by:
toJsonMapin classAbstractJsonLayout<ch.qos.logback.classic.spi.ILoggingEvent>
-
getIncludes
public Set<EventAttribute> getIncludes()
-
setIncludes
public void setIncludes(Set<EventAttribute> includes)
-
getJsonProtocolVersion
public @Nullable String getJsonProtocolVersion()
-
setJsonProtocolVersion
public void setJsonProtocolVersion(@Nullable String jsonProtocolVersion)
-
-