Class AppenderBase<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<E>
- All Implemented Interfaces:
Appender<E>, ContextAware, FilterAttachable<E>, LifeCycle
- Direct Known Subclasses:
AbstractServerSocketAppender, AbstractSocketAppender, CountingConsoleAppender, CyclicBufferAppender, ListAppender, NOPAppender, SiftingAppenderBase, SMTPAppenderBase, SyslogAppenderBase, TrivialLogbackAppender
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
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate intprivate FilterAttachableImpl<E> private booleanThe guard prevents an appender from repeatedly calling its own doAppend method.protected StringAppenders are named.protected booleanprivate intFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a filter.protected abstract voidvoidvoidThis is where an appender accomplishes its work.Get a copy of all the filters contained within this FilterAttachable object.getFilterChainDecision(E event) Loop through the filters in the chain.getName()Get the name of this appender.booleanvoidSet the name of this appender.voidstart()voidstop()toString()Methods inherited from class ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
started
protected volatile boolean started -
guard
private boolean guardThe guard prevents an appender from repeatedly calling its own doAppend method. -
name
Appenders are named. -
fai
-
statusRepeatCount
private int statusRepeatCount -
exceptionCount
private int exceptionCount -
ALLOWED_REPEATS
static final int ALLOWED_REPEATS- See Also:
-
-
Constructor Details
-
AppenderBase
public AppenderBase()
-
-
Method Details
-
getName
-
doAppend
-
append
-
setName
-
start
-
stop
-
isStarted
-
toString
-
addFilter
Description copied from interface:FilterAttachableAdd a filter.- Specified by:
addFilterin interfaceFilterAttachable<E>
-
clearAllFilters
public void clearAllFilters()- Specified by:
clearAllFiltersin interfaceFilterAttachable<E>
-
getCopyOfAttachedFiltersList
Description copied from interface:FilterAttachableGet a copy of all the filters contained within this FilterAttachable object.- Specified by:
getCopyOfAttachedFiltersListin interfaceFilterAttachable<E>- Returns:
- all attached filters as a list
-
getFilterChainDecision
Description copied from interface:FilterAttachableLoop 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.- Specified by:
getFilterChainDecisionin interfaceFilterAttachable<E>
-