Package ch.qos.logback.core
Class AsyncAppenderBase<E>
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.UnsynchronizedAppenderBase<E>
-
- ch.qos.logback.core.AsyncAppenderBase<E>
-
- Type Parameters:
E-
- All Implemented Interfaces:
Appender<E>,AppenderAttachable<E>,ContextAware,FilterAttachable<E>,LifeCycle
- Direct Known Subclasses:
AsyncAppender
@Deprecated(since="2022-01-27") public class AsyncAppenderBase<E> extends UnsynchronizedAppenderBase<E> implements AppenderAttachable<E>
Deprecated.This internal logback API is not supported by AEM as a Cloud Service.This appender and derived classes, log events asynchronously. In order to avoid loss of logging events, this appender should be closed. It is the user's responsibility to close appenders, typically at the end of the application lifecycle. This appender buffers events in aBlockingQueue.AsyncAppenderBase.Workerthread created by this appender takes events from the head of the queue, and dispatches them to the single appender attached to this appender.Please refer to the logback manual for further information about this appender.
- Since:
- 1.0.4
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MAX_FLUSH_TIMEDeprecated.The default maximum queue flush time allowed during appender stop.static intDEFAULT_QUEUE_SIZEDeprecated.The default buffer size.
-
Constructor Summary
Constructors Constructor Description AsyncAppenderBase()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAppender(Appender<E> newAppender)Deprecated.Add an appender.voiddetachAndStopAllAppenders()Deprecated.Detach and processPriorToRemoval all previously added appenders.booleandetachAppender(Appender<E> eAppender)Deprecated.Detach the appender passed as parameter from the list of appenders.booleandetachAppender(java.lang.String name)Deprecated.Detach the appender with the name passed as parameter from the list of appenders.Appender<E>getAppender(java.lang.String name)Deprecated.Get an appender by name.intgetDiscardingThreshold()Deprecated.intgetMaxFlushTime()Deprecated.intgetNumberOfElementsInQueue()Deprecated.Returns the number of elements currently in the blocking queue.intgetQueueSize()Deprecated.intgetRemainingCapacity()Deprecated.The remaining capacity available in the blocking queue.booleanisAttached(Appender<E> eAppender)Deprecated.Returnstrueif the specified appender is in list of attached attached,falseotherwise.booleanisNeverBlock()Deprecated.java.util.Iterator<Appender<E>>iteratorForAppenders()Deprecated.Get an iterator for appenders contained in the parent object.voidsetDiscardingThreshold(int discardingThreshold)Deprecated.voidsetMaxFlushTime(int maxFlushTime)Deprecated.voidsetNeverBlock(boolean neverBlock)Deprecated.voidsetQueueSize(int queueSize)Deprecated.voidstart()Deprecated.voidstop()Deprecated.-
Methods inherited from class ch.qos.logback.core.UnsynchronizedAppenderBase
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, getStatusManager, setContext
-
Methods inherited from class java.lang.Object
equals, 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
-
DEFAULT_QUEUE_SIZE
public static final int DEFAULT_QUEUE_SIZE
Deprecated.The default buffer size.- See Also:
- Constant Field Values
-
DEFAULT_MAX_FLUSH_TIME
public static final int DEFAULT_MAX_FLUSH_TIME
Deprecated.The default maximum queue flush time allowed during appender stop. If the worker takes longer than this time it will exit, discarding any remaining items in the queue- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start()
Deprecated.- Specified by:
startin interfaceLifeCycle- Overrides:
startin classUnsynchronizedAppenderBase<E>
-
stop
public void stop()
Deprecated.- Specified by:
stopin interfaceLifeCycle- Overrides:
stopin classUnsynchronizedAppenderBase<E>
-
getQueueSize
public int getQueueSize()
Deprecated.
-
setQueueSize
public void setQueueSize(int queueSize)
Deprecated.
-
getDiscardingThreshold
public int getDiscardingThreshold()
Deprecated.
-
setDiscardingThreshold
public void setDiscardingThreshold(int discardingThreshold)
Deprecated.
-
getMaxFlushTime
public int getMaxFlushTime()
Deprecated.
-
setMaxFlushTime
public void setMaxFlushTime(int maxFlushTime)
Deprecated.
-
getNumberOfElementsInQueue
public int getNumberOfElementsInQueue()
Deprecated.Returns the number of elements currently in the blocking queue.- Returns:
- number of elements currently in the queue.
-
setNeverBlock
public void setNeverBlock(boolean neverBlock)
Deprecated.
-
isNeverBlock
public boolean isNeverBlock()
Deprecated.
-
getRemainingCapacity
public int getRemainingCapacity()
Deprecated.The remaining capacity available in the blocking queue.- Returns:
- the remaining capacity
-
addAppender
public void addAppender(Appender<E> newAppender)
Deprecated.Description copied from interface:AppenderAttachableAdd an appender.- Specified by:
addAppenderin interfaceAppenderAttachable<E>
-
iteratorForAppenders
public java.util.Iterator<Appender<E>> iteratorForAppenders()
Deprecated.Description copied from interface:AppenderAttachableGet an iterator for appenders contained in the parent object.- Specified by:
iteratorForAppendersin interfaceAppenderAttachable<E>
-
getAppender
public Appender<E> getAppender(java.lang.String name)
Deprecated.Description copied from interface:AppenderAttachableGet an appender by name.- Specified by:
getAppenderin interfaceAppenderAttachable<E>
-
isAttached
public boolean isAttached(Appender<E> eAppender)
Deprecated.Description copied from interface:AppenderAttachableReturnstrueif the specified appender is in list of attached attached,falseotherwise.- Specified by:
isAttachedin interfaceAppenderAttachable<E>
-
detachAndStopAllAppenders
public void detachAndStopAllAppenders()
Deprecated.Description copied from interface:AppenderAttachableDetach and processPriorToRemoval all previously added appenders.- Specified by:
detachAndStopAllAppendersin interfaceAppenderAttachable<E>
-
detachAppender
public boolean detachAppender(Appender<E> eAppender)
Deprecated.Description copied from interface:AppenderAttachableDetach the appender passed as parameter from the list of appenders.- Specified by:
detachAppenderin interfaceAppenderAttachable<E>
-
detachAppender
public boolean detachAppender(java.lang.String name)
Deprecated.Description copied from interface:AppenderAttachableDetach the appender with the name passed as parameter from the list of appenders.- Specified by:
detachAppenderin interfaceAppenderAttachable<E>
-
-