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()
String
getJsonProtocolVersion()
void
setIncludes(Set<EventAttribute> includes)
void
setIncludesMdcKeys(Set<String> includesMdcKeys)
void
setJsonProtocolVersion(String jsonProtocolVersion)
void
start()
void
stop()
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:
start
in interfacech.qos.logback.core.spi.LifeCycle
- Overrides:
start
in classch.qos.logback.core.LayoutBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
stop
public void stop()
- Specified by:
stop
in interfacech.qos.logback.core.spi.LifeCycle
- Overrides:
stop
in 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:AbstractJsonLayout
Converts the provided logging event to a genericMap
- Specified by:
toJsonMap
in classAbstractJsonLayout<ch.qos.logback.classic.spi.ILoggingEvent>
-
getIncludes
public Set<EventAttribute> getIncludes()
-
setIncludes
public void setIncludes(Set<EventAttribute> includes)
-
getJsonProtocolVersion
@Nullable public String getJsonProtocolVersion()
-
setJsonProtocolVersion
public void setJsonProtocolVersion(@Nullable String jsonProtocolVersion)
-
-