Class ThrottlingAppenderWrapper<E extends ch.qos.logback.core.spi.DeferredProcessingAware>

java.lang.Object
io.dropwizard.logback.ThrottlingAppenderWrapper<E>
All Implemented Interfaces:
ch.qos.logback.core.Appender<E>, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.FilterAttachable<E>, ch.qos.logback.core.spi.LifeCycle, AsyncAppenderBaseProxy<E>

public class ThrottlingAppenderWrapper<E extends ch.qos.logback.core.spi.DeferredProcessingAware> extends Object implements ch.qos.logback.core.Appender<E>, AsyncAppenderBaseProxy<E>
An AsyncAppenderBase that applies throttling to a proxied appender. Throttling is defined by an average duration between messages. Throttled messages are discarded.
  • Constructor Details

    • ThrottlingAppenderWrapper

      public ThrottlingAppenderWrapper(ch.qos.logback.core.AsyncAppenderBase<E> delegate, long messageRate, TimeUnit rateUnit)
  • Method Details

    • getAppender

      public ch.qos.logback.core.AsyncAppenderBase<E> getAppender()
      Specified by:
      getAppender in interface AsyncAppenderBaseProxy<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    • start

      public void start()
      Specified by:
      start in interface ch.qos.logback.core.spi.LifeCycle
    • stop

      public void stop()
      Specified by:
      stop in interface ch.qos.logback.core.spi.LifeCycle
    • isStarted

      public boolean isStarted()
      Specified by:
      isStarted in interface ch.qos.logback.core.spi.LifeCycle
    • doAppend

      public void doAppend(E event) throws ch.qos.logback.core.LogbackException
      Specified by:
      doAppend in interface ch.qos.logback.core.Appender<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
      Throws:
      ch.qos.logback.core.LogbackException
    • getName

      public String getName()
      Specified by:
      getName in interface ch.qos.logback.core.Appender<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    • setName

      public void setName(String name)
      Specified by:
      setName in interface ch.qos.logback.core.Appender<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    • getContext

      public ch.qos.logback.core.Context getContext()
      Specified by:
      getContext in interface ch.qos.logback.core.spi.ContextAware
    • setContext

      public void setContext(ch.qos.logback.core.Context context)
      Specified by:
      setContext in interface ch.qos.logback.core.spi.ContextAware
    • addStatus

      public void addStatus(ch.qos.logback.core.status.Status status)
      Specified by:
      addStatus in interface ch.qos.logback.core.spi.ContextAware
    • addInfo

      public void addInfo(String msg)
      Specified by:
      addInfo in interface ch.qos.logback.core.spi.ContextAware
    • addInfo

      public void addInfo(String msg, Throwable ex)
      Specified by:
      addInfo in interface ch.qos.logback.core.spi.ContextAware
    • addWarn

      public void addWarn(String msg)
      Specified by:
      addWarn in interface ch.qos.logback.core.spi.ContextAware
    • addWarn

      public void addWarn(String msg, Throwable ex)
      Specified by:
      addWarn in interface ch.qos.logback.core.spi.ContextAware
    • addError

      public void addError(String msg)
      Specified by:
      addError in interface ch.qos.logback.core.spi.ContextAware
    • addError

      public void addError(String msg, Throwable ex)
      Specified by:
      addError in interface ch.qos.logback.core.spi.ContextAware
    • addFilter

      public void addFilter(ch.qos.logback.core.filter.Filter<E> newFilter)
      Specified by:
      addFilter in interface ch.qos.logback.core.spi.FilterAttachable<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    • clearAllFilters

      public void clearAllFilters()
      Specified by:
      clearAllFilters in interface ch.qos.logback.core.spi.FilterAttachable<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    • getCopyOfAttachedFiltersList

      public List<ch.qos.logback.core.filter.Filter<E>> getCopyOfAttachedFiltersList()
      Specified by:
      getCopyOfAttachedFiltersList in interface ch.qos.logback.core.spi.FilterAttachable<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    • getFilterChainDecision

      public ch.qos.logback.core.spi.FilterReply getFilterChainDecision(E event)
      Specified by:
      getFilterChainDecision in interface ch.qos.logback.core.spi.FilterAttachable<E extends ch.qos.logback.core.spi.DeferredProcessingAware>
    • toString

      public String toString()
      Overrides:
      toString in class Object