Class AbstractJsonLayout<E>

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.LayoutBase<E>
io.dropwizard.logging.json.layout.AbstractJsonLayout<E>
Type Parameters:
E - represents the type of the event
All Implemented Interfaces:
ch.qos.logback.core.Layout<E>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle
Direct Known Subclasses:
AccessJsonLayout, EventJsonLayout

public abstract class AbstractJsonLayout<E> extends ch.qos.logback.core.LayoutBase<E>
Provides the common functionality for building JSON representations of IAccessEvent and ILoggingEvent events.
  • Field Summary

    Fields inherited from class ch.qos.logback.core.LayoutBase

    started

    Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

    context
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable String
    doLayout(E event)
     
    protected abstract Map<String,Object>
    toJsonMap(E event)
    Converts the provided logging event to a generic Map

    Methods inherited from class ch.qos.logback.core.LayoutBase

    getContentType, getContext, getFileFooter, getFileHeader, getPresentationFooter, getPresentationHeader, isStarted, setContext, setFileFooter, setFileHeader, setPresentationFooter, setPresentationHeader, start, stop

    Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase

    addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface ch.qos.logback.core.spi.ContextAware

    addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn
  • Constructor Details

    • AbstractJsonLayout

      protected AbstractJsonLayout(JsonFormatter jsonFormatter)
  • Method Details

    • doLayout

      public @Nullable String doLayout(E event)
    • toJsonMap

      protected abstract Map<String,Object> toJsonMap(E event)
      Converts the provided logging event to a generic Map