Class Loki4jAppender

  • All Implemented Interfaces:
    ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.FilterAttachable<ch.qos.logback.classic.spi.ILoggingEvent>, ch.qos.logback.core.spi.LifeCycle

    public final class Loki4jAppender
    extends ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
    Main appender that provides functionality for sending log record batches to Loki
    • Field Summary

      • Fields inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase

        name, started
      • Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase

        context
    • Constructor Summary

      Constructors 
      Constructor Description
      Loki4jAppender()  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected void append​(ch.qos.logback.classic.spi.ILoggingEvent event)  
      void setBatchMaxBytes​(int batchMaxBytes)  
      void setBatchMaxItems​(int batchMaxItems)  
      void setBatchSize​(int batchSize)
      Deprecated.
      void setBatchTimeoutMs​(long batchTimeoutMs)  
      void setDrainOnStop​(boolean drainOnStop)  
      void setFormat​(Loki4jEncoder encoder)
      "format" instead of "encoder" in the name allows to specify the default implementation, so users don't have to write full-qualified class name by default
      void setHttp​(HttpSender sender)
      "http" instead of "sender" is just to have a more clear name for the configuration section
      void setMetricsEnabled​(boolean metricsEnabled)  
      void setSendQueueMaxBytes​(long sendQueueMaxBytes)  
      void setUseDirectBuffers​(boolean useDirectBuffers)  
      void setVerbose​(boolean verbose)  
      void start()  
      void stop()  
      • Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase

        addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
      • 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, wait, wait, wait
      • Methods inherited from interface ch.qos.logback.core.spi.ContextAware

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

      • Loki4jAppender

        public Loki4jAppender()
    • Method Detail

      • start

        public void start()
        Specified by:
        start in interface ch.qos.logback.core.spi.LifeCycle
        Overrides:
        start in class ch.qos.logback.core.UnsynchronizedAppenderBase<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.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
      • append

        protected void append​(ch.qos.logback.classic.spi.ILoggingEvent event)
        Specified by:
        append in class ch.qos.logback.core.UnsynchronizedAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
      • setBatchSize

        @Deprecated
        public void setBatchSize​(int batchSize)
        Deprecated.
      • setBatchMaxItems

        public void setBatchMaxItems​(int batchMaxItems)
      • setBatchMaxBytes

        public void setBatchMaxBytes​(int batchMaxBytes)
      • setBatchTimeoutMs

        public void setBatchTimeoutMs​(long batchTimeoutMs)
      • setSendQueueMaxBytes

        public void setSendQueueMaxBytes​(long sendQueueMaxBytes)
      • setFormat

        public void setFormat​(Loki4jEncoder encoder)
        "format" instead of "encoder" in the name allows to specify the default implementation, so users don't have to write full-qualified class name by default
      • setHttp

        public void setHttp​(HttpSender sender)
        "http" instead of "sender" is just to have a more clear name for the configuration section
      • setVerbose

        public void setVerbose​(boolean verbose)
      • setMetricsEnabled

        public void setMetricsEnabled​(boolean metricsEnabled)
      • setDrainOnStop

        public void setDrainOnStop​(boolean drainOnStop)
      • setUseDirectBuffers

        public void setUseDirectBuffers​(boolean useDirectBuffers)