Package ch.qos.logback.core
Class UnsynchronizedAppenderBase<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.UnsynchronizedAppenderBase<E>
- All Implemented Interfaces:
Appender<E>
,ContextAware
,FilterAttachable<E>
,LifeCycle
- Direct Known Subclasses:
AsyncAppenderBase
,OutputStreamAppender
Similar to AppenderBase except that derived appenders need to handle
thread synchronization on their own.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
private int
private FilterAttachableImpl
<E> private ThreadLocal
<Boolean> The guard prevents an appender from repeatedly calling its own doAppend method.protected String
Appenders are named.protected boolean
private int
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a filter.protected abstract void
void
void
This 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.boolean
void
Set the name of this appender.void
start()
void
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
-
started
protected boolean started -
guard
The 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
-
UnsynchronizedAppenderBase
public UnsynchronizedAppenderBase()
-
-
Method Details
-
getName
Description copied from interface:Appender
Get the name of this appender. The name uniquely identifies the appender. -
doAppend
Description copied from interface:Appender
This is where an appender accomplishes its work. Note that the argument is of type Object. -
append
-
setName
Set the name of this appender. -
start
public void start() -
stop
public void stop() -
isStarted
public boolean isStarted() -
toString
-
addFilter
Description copied from interface:FilterAttachable
Add a filter.- Specified by:
addFilter
in interfaceFilterAttachable<E>
-
clearAllFilters
public void clearAllFilters()- Specified by:
clearAllFilters
in interfaceFilterAttachable<E>
-
getCopyOfAttachedFiltersList
Description copied from interface:FilterAttachable
Get a copy of all the filters contained within this FilterAttachable object.- Specified by:
getCopyOfAttachedFiltersList
in interfaceFilterAttachable<E>
- Returns:
- all attached filters as a list
-
getFilterChainDecision
Description copied from interface:FilterAttachable
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.- Specified by:
getFilterChainDecision
in interfaceFilterAttachable<E>
-