Interface Appender<E>
- Type Parameters:
E- the event type accepted by this appender
- All Superinterfaces:
ContextAware, FilterAttachable<E>, LifeCycle
- All Known Implementing Classes:
AbstractServerSocketAppender, AbstractSocketAppender, AbstractSSLSocketAppender, AppenderBase, AsyncAppender, AsyncAppenderBase, ConsoleAppender, CyclicBufferAppender, DelayingListAppender, FileAppender, ListAppender, NOPAppender, NPEAppender, OutputStreamAppender, RollingFileAppender, SiftingAppender, SiftingAppenderBase, SMTPAppender, SMTPAppenderBase, SocketAppender, SSLServerSocketAppenderBase, SSLSocketAppender, StringListAppender, SyslogAppender, SyslogAppenderBase, UnsynchronizedAppenderBase, WithLayoutListAppender
Implementations are typically configured and managed by a LoggerContext.
The type parameter E represents the event type the appender consumes (for
example a log event object). Implementations should honor lifecycle methods
from LifeCycle and may be ContextAware and
FilterAttachable to support contextual information and filtering.
Concurrency: appenders are generally invoked by multiple threads. Implementations
must ensure thread-safety where applicable (for example when writing to shared
resources). The doAppend(Object) method may be called concurrently.
-
Method Summary
Methods inherited from interface ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextMethods inherited from interface FilterAttachable
addFilter, clearAllFilters, getCopyOfAttachedFiltersList, getFilterChainDecision
-
Method Details
-
getName
-
doAppend
This is where an appender accomplishes its work: format and deliver the provided event to the appender's destination.Implementations should apply any configured filters before outputting the event. Implementations should avoid throwing runtime exceptions; if an error occurs that cannot be handled internally, a
LogbackException(or a subtype) may be thrown to indicate a failure during append.- Parameters:
event- the event to append; may not benull- Throws:
LogbackException- if the append fails in a way that needs to be propagated to the caller
-
setName
-