Class 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
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      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 interface ch.qos.logback.core.spi.ContextAware

        addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn
    • Constructor Detail

      • AbstractJsonLayout

        protected AbstractJsonLayout​(JsonFormatter jsonFormatter)
    • Method Detail

      • 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