Class WorkflowAppender
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase
org.opentestfactory.services.components.logger.WorkflowAppender
- All Implemented Interfaces:
ch.qos.logback.core.Appender,ch.qos.logback.core.spi.ContextAware,ch.qos.logback.core.spi.FilterAttachable,ch.qos.logback.core.spi.LifeCycle
public class WorkflowAppender
extends ch.qos.logback.core.AppenderBase
This logback appender publishes workflow-related logs as notifications. In nominal flow, the log
call will only queue notifications for publication by a worker thread to avoid slowing
application threads. If the worker thread cannot keep up, once the queue size limit is reached
the appender will fall back to publishing from application threads (but first publishing the head
of the queue to keep log order within workflows as much as possible).
- Author:
- edegenetais
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected LinkedBlockingQueue<org.opentestfactory.dto.v1.WorkflowLogNotification> protected ThreadFields inherited from class ch.qos.logback.core.AppenderBase
name, startedFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidorg.opentestfactory.dto.v1.WorkflowLogNotificationbuildNotification(WorkflowContext ctx, Object e) voidsetQueueSize(Integer size) Use this optional field to tune queue size.voidstart()voidstop()Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
loggingQueue
-
publicationWorker
-
-
Constructor Details
-
WorkflowAppender
-
-
Method Details
-
setQueueSize
Use this optional field to tune queue size. If it is not used, the appender will default toDEFAULT_QUEUE_SIZE.- Parameters:
size-
-
start
public void start()- Specified by:
startin interfacech.qos.logback.core.spi.LifeCycle- Overrides:
startin classch.qos.logback.core.AppenderBase
-
stop
public void stop()- Specified by:
stopin interfacech.qos.logback.core.spi.LifeCycle- Overrides:
stopin classch.qos.logback.core.AppenderBase
-
append
- Specified by:
appendin classch.qos.logback.core.AppenderBase
-
buildNotification
public org.opentestfactory.dto.v1.WorkflowLogNotification buildNotification(WorkflowContext ctx, Object e)
-