public class CompositeAppender<T>
extends ch.qos.logback.core.AppenderBase<T>
CompositeAppender
is an Appender
implementation implementing
the Composite Software Design Pattern
The Composite Software Design Pattern enables two or more Appender
objects to be composed
and treated as a single instance of Appender
.Appender
,
AppenderBase
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DEFAULT_NAME |
Modifier and Type | Method and Description |
---|---|
protected void |
append(T eventObject) |
static <T> ch.qos.logback.core.Appender<T> |
compose(ch.qos.logback.core.Appender<T>... appenders)
Composes an array of
Appenders into a CompositeAppender . |
static <T> ch.qos.logback.core.Appender<T> |
compose(ch.qos.logback.core.Appender<T> one,
ch.qos.logback.core.Appender<T> two)
Factory method used to compose two
Appender objects into a Composite Appender . |
static <T> ch.qos.logback.core.Appender<T> |
compose(java.lang.Iterable<ch.qos.logback.core.Appender<T>> appenders)
|
protected ch.qos.logback.core.Appender<T> |
getAppenderOne() |
protected ch.qos.logback.core.Appender<T> |
getAppenderTwo() |
ch.qos.logback.core.Context |
getContext() |
void |
setContext(ch.qos.logback.core.Context context) |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, start, stop, toString
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager
protected static final java.lang.String DEFAULT_NAME
public static <T> ch.qos.logback.core.Appender<T> compose(ch.qos.logback.core.Appender<T> one, ch.qos.logback.core.Appender<T> two)
Appender
objects into a Composite Appender
.T
- type
of Appender
to compose.one
- first Appender
to compose.two
- second Appender
to compose.Appender
one if Appender
two is null;
Return Appender
two if Appender
one is null.
Otherwise, return a Composite Appender
composed of Appender
one
and Appender
two.Appender
public static <T> ch.qos.logback.core.Appender<T> compose(ch.qos.logback.core.Appender<T>... appenders)
Appenders
into a CompositeAppender
.
This operation is null-safe.T
- type
of the logging events processed by the Appenders
.appenders
- array of Appenders
to compose; may be null.Appenders
; returns null if the array is empty.compose(Iterable)
public static <T> ch.qos.logback.core.Appender<T> compose(java.lang.Iterable<ch.qos.logback.core.Appender<T>> appenders)
T
- type
of the logging events processed by the Appenders
.appenders
- Iterable
of Appenders
to compose; may be null.Iterable
of Appenders
; returns null
if the Iterable
is null or empty.compose(Appender, Appender)
,
Iterable
protected ch.qos.logback.core.Appender<T> getAppenderOne()
protected ch.qos.logback.core.Appender<T> getAppenderTwo()
public void setContext(ch.qos.logback.core.Context context)
setContext
in interface ch.qos.logback.core.spi.ContextAware
setContext
in class ch.qos.logback.core.spi.ContextAwareBase
public ch.qos.logback.core.Context getContext()
getContext
in interface ch.qos.logback.core.spi.ContextAware
getContext
in class ch.qos.logback.core.spi.ContextAwareBase