Class StructuredLogEncoder

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.encoder.EncoderBase<ch.qos.logback.classic.spi.ILoggingEvent>
org.springframework.boot.logging.logback.StructuredLogEncoder
All Implemented Interfaces:
ch.qos.logback.core.encoder.Encoder<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle

public class StructuredLogEncoder extends ch.qos.logback.core.encoder.EncoderBase<ch.qos.logback.classic.spi.ILoggingEvent>
Logback encoder for structured logging.
Since:
3.4.0
See Also:
  • Field Summary

    Fields inherited from class ch.qos.logback.core.encoder.EncoderBase

    started

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

    context
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    encode(ch.qos.logback.classic.spi.ILoggingEvent event)
     
    byte[]
     
    byte[]
     
    void
     
    void
    setFormat(String format)
     
    void
     
    void
     

    Methods inherited from class ch.qos.logback.core.encoder.EncoderBase

    isStarted

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

    addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext

    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, getContext, setContext
  • Constructor Details

    • StructuredLogEncoder

      public StructuredLogEncoder()
  • Method Details

    • setFormat

      public void setFormat(String format)
    • setCharset

      public void setCharset(Charset charset)
    • start

      public void start()
      Specified by:
      start in interface ch.qos.logback.core.spi.LifeCycle
      Overrides:
      start in class ch.qos.logback.core.encoder.EncoderBase<ch.qos.logback.classic.spi.ILoggingEvent>
    • stop

      public void stop()
      Specified by:
      stop in interface ch.qos.logback.core.spi.LifeCycle
      Overrides:
      stop in class ch.qos.logback.core.encoder.EncoderBase<ch.qos.logback.classic.spi.ILoggingEvent>
    • headerBytes

      public byte[] headerBytes()
    • encode

      public byte[] encode(ch.qos.logback.classic.spi.ILoggingEvent event)
    • footerBytes

      public byte[] footerBytes()