Top Description Fields Constructors Methods
ch.qos.logback.core

public abstract Class AppenderBase<E>

extends ContextAwareBase
implements Appender<E>
Class Inheritance
All Implemented Interfaces
ch.qos.logback.core.Appender, ch.qos.logback.core.spi.FilterAttachable, ch.qos.logback.core.spi.ContextAware, ch.qos.logback.core.spi.LifeCycle
Known Direct Subclasses
ch.qos.logback.core.helpers.NOPAppender, ch.qos.logback.core.net.AbstractSocketAppender, ch.qos.logback.core.net.SMTPAppenderBase, ch.qos.logback.core.net.SyslogAppenderBase, ch.qos.logback.core.net.server.AbstractServerSocketAppender, ch.qos.logback.core.read.CyclicBufferAppender, ch.qos.logback.core.read.ListAppender, ch.qos.logback.core.sift.SiftingAppenderBase, ch.qos.logback.core.testUtil.NPEAppender, ch.qos.logback.core.testUtil.StringListAppender
Imports
java.util.List, ch.qos.logback.core.filter.Filter, ch.qos.logback.core.spi.ContextAwareBase, .FilterAttachableImpl, .FilterReply, ch.qos.logback.core.status.WarnStatus

Sets a skeleton implementation for appenders.

For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#AppenderBase

Author
Ceki Gülcü

Field Summary

Modifier and TypeField and Description
pack-priv static final int
private int
private FilterAttachableImpl<E>
private boolean
guard

The guard prevents an appender from repeatedly calling its own doAppend method.

protected String
name

Appenders are named.

protected volatile boolean
private int
Inherited from ch.qos.logback.core.spi.ContextAwareBase:
context

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
protected abstract void
append(E eventObject)

public void
public synchronized void
doAppend(E eventObject)

Implements ch.qos.logback.core.Appender.doAppend.

This is where an appender accomplishes its work.
public List<Filter<E>>
getCopyOfAttachedFiltersList()

Implements ch.qos.logback.core.spi.FilterAttachable.getCopyOfAttachedFiltersList.

Get a copy of all the filters contained within this FilterAttachable object.
public FilterReply
getFilterChainDecision(E event)

Implements ch.qos.logback.core.spi.FilterAttachable.getFilterChainDecision.

Loop through the filters in the chain.
public String
getName()

Implements ch.qos.logback.core.Appender.getName.

Get the name of this appender.
public boolean
public void
setName(String name)

Implements ch.qos.logback.core.Appender.setName.

Set the name of this appender.
public void
public void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from ch.qos.logback.core.spi.ContextAwareBase:
addErroraddErroraddInfoaddInfoaddStatusaddWarnaddWarngetContextgetDeclaredOrigingetStatusManagersetContext

Field Detail

ALLOWED_REPEATSback to summary
pack-priv static final int ALLOWED_REPEATS
exceptionCountback to summary
private int exceptionCount
faiback to summary
private FilterAttachableImpl<E> fai
guardback to summary
private boolean guard

The guard prevents an appender from repeatedly calling its own doAppend method.

nameback to summary
protected String name

Appenders are named.

startedback to summary
protected volatile boolean started
statusRepeatCountback to summary
private int statusRepeatCount

Constructor Detail

AppenderBaseback to summary
public AppenderBase()

Method Detail

addFilterback to summary
public void addFilter(Filter<E> newFilter)

Implements ch.qos.logback.core.spi.FilterAttachable.addFilter.

Doc from ch.qos.logback.core.spi.FilterAttachable.addFilter.

Add a filter.

appendback to summary
protected abstract void append(E eventObject)
clearAllFiltersback to summary
public void clearAllFilters()

Implements ch.qos.logback.core.spi.FilterAttachable.clearAllFilters.

doAppendback to summary
public synchronized void doAppend(E eventObject)

Implements ch.qos.logback.core.Appender.doAppend.

Doc from ch.qos.logback.core.Appender.doAppend.

This is where an appender accomplishes its work. Note that the argument is of type Object.

getCopyOfAttachedFiltersListback to summary
public List<Filter<E>> getCopyOfAttachedFiltersList()

Implements ch.qos.logback.core.spi.FilterAttachable.getCopyOfAttachedFiltersList.

Doc from ch.qos.logback.core.spi.FilterAttachable.getCopyOfAttachedFiltersList.

Get a copy of all the filters contained within this FilterAttachable object.

Returns:List<Filter<E>>

all attached filters as a list

getFilterChainDecisionback to summary
public FilterReply getFilterChainDecision(E event)

Implements ch.qos.logback.core.spi.FilterAttachable.getFilterChainDecision.

Doc from ch.qos.logback.core.spi.FilterAttachable.getFilterChainDecision.

Loop through the filters in the chain. As soon as a filter decides on ACCEPT or DENY, then that value is returned. If all of the filters return NEUTRAL, then NEUTRAL is returned.

getNameback to summary
public String getName()

Implements ch.qos.logback.core.Appender.getName.

Doc from ch.qos.logback.core.Appender.getName.

Get the name of this appender. The name uniquely identifies the appender.

isStartedback to summary
public boolean isStarted()

Implements ch.qos.logback.core.spi.LifeCycle.isStarted.

setNameback to summary
public void setName(String name)

Implements ch.qos.logback.core.Appender.setName.

Set the name of this appender.

startback to summary
public void start()

Implements ch.qos.logback.core.spi.LifeCycle.start.

stopback to summary
public void stop()

Implements ch.qos.logback.core.spi.LifeCycle.stop.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.