Package stroom.query.audit.logback
Class FifoLogbackAppender<E>
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- stroom.query.audit.logback.FifoLogbackAppender<E>
-
- Type Parameters:
E
- The log object
- All Implemented Interfaces:
ch.qos.logback.core.Appender<E>
,ch.qos.logback.core.spi.ContextAware
,ch.qos.logback.core.spi.FilterAttachable<E>
,ch.qos.logback.core.spi.LifeCycle
public class FifoLogbackAppender<E> extends ch.qos.logback.core.spi.ContextAwareBase implements ch.qos.logback.core.Appender<E>
This is a Logback appender that simply puts logs into an in-memory queue. This class is intended for use in integration tests, to prevent those tests needing to connect to kafka, or read files, but they can still check that auditing is happening.
-
-
Constructor Summary
Constructors Constructor Description FifoLogbackAppender()
-
Method Summary
Modifier and Type Method Description void
addFilter(ch.qos.logback.core.filter.Filter<E> filter)
void
clearAllFilters()
void
doAppend(E e)
java.util.List<ch.qos.logback.core.filter.Filter<E>>
getCopyOfAttachedFiltersList()
ch.qos.logback.core.spi.FilterReply
getFilterChainDecision(E e)
java.lang.String
getName()
boolean
isStarted()
static java.util.List<java.lang.Object>
popLogs()
void
setName(java.lang.String s)
void
start()
void
stop()
-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Method Detail
-
popLogs
public static java.util.List<java.lang.Object> popLogs()
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfacech.qos.logback.core.Appender<E>
-
doAppend
public void doAppend(E e) throws ch.qos.logback.core.LogbackException
- Specified by:
doAppend
in interfacech.qos.logback.core.Appender<E>
- Throws:
ch.qos.logback.core.LogbackException
-
setName
public void setName(java.lang.String s)
- Specified by:
setName
in interfacech.qos.logback.core.Appender<E>
-
addFilter
public void addFilter(ch.qos.logback.core.filter.Filter<E> filter)
- Specified by:
addFilter
in interfacech.qos.logback.core.spi.FilterAttachable<E>
-
clearAllFilters
public void clearAllFilters()
- Specified by:
clearAllFilters
in interfacech.qos.logback.core.spi.FilterAttachable<E>
-
getCopyOfAttachedFiltersList
public java.util.List<ch.qos.logback.core.filter.Filter<E>> getCopyOfAttachedFiltersList()
- Specified by:
getCopyOfAttachedFiltersList
in interfacech.qos.logback.core.spi.FilterAttachable<E>
-
getFilterChainDecision
public ch.qos.logback.core.spi.FilterReply getFilterChainDecision(E e)
- Specified by:
getFilterChainDecision
in interfacech.qos.logback.core.spi.FilterAttachable<E>
-
start
public void start()
- Specified by:
start
in interfacech.qos.logback.core.spi.LifeCycle
-
stop
public void stop()
- Specified by:
stop
in interfacech.qos.logback.core.spi.LifeCycle
-
isStarted
public boolean isStarted()
- Specified by:
isStarted
in interfacech.qos.logback.core.spi.LifeCycle
-
-