ch.qos.logback.core.sift

## Class SiftingAppenderBase<E>

- java.lang.Object
- - ch.qos.logback.core.spi.ContextAwareBase
  - - ch.qos.logback.core.AppenderBase<E>
    - - ch.qos.logback.core.sift.SiftingAppenderBase<E>

All Implemented Interfaces:
  Appender<E>, ContextAware, FilterAttachable<E>, LifeCycle

Direct Known Subclasses:
  SiftingAppender, SiftingAppender

    public abstract class SiftingAppenderBase<E>
    extends AppenderBase<E>

This appender serves as the base class for actual SiftingAppenders implemented by the logback-classic and logback-access modules. In a nutshell, a SiftingAppender contains other appenders which it can build dynamically depending on discriminating values supplied by the event currently being processed. The appender to build (dynamically) is specified as part of a configuration file.

Author:
  Ceki Gulcu

### Field Summary

Fields
`protected AppenderTracker<E>` `appenderTracker`

### 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 and Description
`SiftingAppenderBase()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected void` `append(E event)`
`protected abstract boolean` `eventMarksEndOfLife(E event)`
`AppenderTracker<E>` `getAppenderTracker()`
`Discriminator<E>` `getDiscriminator()`
`String` `getDiscriminatorKey()`
`int` `getMaxAppenderCount()`
`Duration` `getTimeout()`
`protected abstract long` `getTimestamp(E event)`
`void` `setAppenderFactory(AppenderFactory<E> appenderFactory)` This setter is intended to be invoked by SiftAction.
`void` `setDiscriminator(Discriminator<E> discriminator)`
`void` `setMaxAppenderCount(int maxAppenderCount)`
`void` `setTimeout(Duration timeout)`
`void` `start()`
`void` `stop()`

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

`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`

### Field Detail

#### appenderTracker

    protected AppenderTracker<E> appenderTracker

### Constructor Detail

#### SiftingAppenderBase

    public SiftingAppenderBase()

### Method Detail

#### getTimeout

    public Duration getTimeout()

#### setTimeout

    public void setTimeout(Duration timeout)

#### getMaxAppenderCount

    public int getMaxAppenderCount()

#### setMaxAppenderCount

    public void setMaxAppenderCount(int maxAppenderCount)

#### setAppenderFactory

    public void setAppenderFactory(AppenderFactory<E> appenderFactory)

This setter is intended to be invoked by SiftAction. Customers have no reason to invoke this method directly.

#### start

    public void start()

Specified by:
  `start` in interface `LifeCycle`
Overrides:
  `start` in class `AppenderBase<E>`

#### stop

    public void stop()

Specified by:
  `stop` in interface `LifeCycle`
Overrides:
  `stop` in class `AppenderBase<E>`

#### getTimestamp

    protected abstract long getTimestamp(E event)

#### append

    protected void append(E event)

Specified by:
  `append` in class `AppenderBase<E>`

#### eventMarksEndOfLife

    protected abstract boolean eventMarksEndOfLife(E event)

#### getDiscriminator

    public Discriminator<E> getDiscriminator()

#### setDiscriminator

    public void setDiscriminator(Discriminator<E> discriminator)

#### getAppenderTracker

    public AppenderTracker<E> getAppenderTracker()

Since:
  0.9.19

#### getDiscriminatorKey

    public String getDiscriminatorKey()