Class InstrumentedAppender

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
com.codahale.metrics.logback.InstrumentedAppender
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 class InstrumentedAppender extends ch.qos.logback.core.AppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
A Logback Appender which has six meters, one for each logging level and one for the total number of statements being logged. The meter names are the logging level names appended to the name of the appender.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Meter
     
    private Meter
     
    private Meter
     
    private Meter
     
    private final MetricRegistry
     
    private Meter
     
    private Meter
     

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

    name, started

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

    context
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instrumented appender using the given registry.
    Create a new instrumented appender using the given registry name.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    append(ch.qos.logback.classic.spi.ILoggingEvent event)
     
    void
     

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

    addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, stop, 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
  • Field Details

  • Constructor Details

    • InstrumentedAppender

      public InstrumentedAppender(String registryName)
      Create a new instrumented appender using the given registry name.
      Parameters:
      registryName - the name of the registry in SharedMetricRegistries
    • InstrumentedAppender

      public InstrumentedAppender(MetricRegistry registry)
      Create a new instrumented appender using the given registry.
      Parameters:
      registry - the metric registry
  • Method Details

    • start

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