Class CompositeAppender<T>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<T>
org.springframework.geode.logging.slf4j.logback.CompositeAppender<T>
- All Implemented Interfaces:
ch.qos.logback.core.Appender<T>
,ch.qos.logback.core.spi.ContextAware
,ch.qos.logback.core.spi.FilterAttachable<T>
,ch.qos.logback.core.spi.LifeCycle
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
.- Since:
- 1.3.0
- See Also:
-
Appender
AppenderBase
-
Field Summary
Fields inherited from class ch.qos.logback.core.AppenderBase
name, started
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
static <T> ch.qos.logback.core.Appender<T>
compose
(ch.qos.logback.core.Appender<T>... appenders) Composes an array ofAppenders
into aCompositeAppender
.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 twoAppender
objects into a CompositeAppender
.static <T> ch.qos.logback.core.Appender<T>
protected ch.qos.logback.core.Appender<T>
protected ch.qos.logback.core.Appender<T>
ch.qos.logback.core.Context
void
setContext
(ch.qos.logback.core.Context context) Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, start, stop, toString
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getDeclaredOrigin, getStatusManager
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn
-
Field Details
-
DEFAULT_NAME
- See Also:
-
-
Method Details
-
compose
public 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 twoAppender
objects into a CompositeAppender
.- Type Parameters:
T
-type
ofAppender
to compose.- Parameters:
one
- firstAppender
to compose.two
- secondAppender
to compose.- Returns:
Appender
one ifAppender
two is null; ReturnAppender
two ifAppender
one is null. Otherwise, return a CompositeAppender
composed ofAppender
one andAppender
two.- See Also:
-
Appender
-
compose
public static <T> ch.qos.logback.core.Appender<T> compose(ch.qos.logback.core.Appender<T>... appenders) Composes an array ofAppenders
into aCompositeAppender
. This operation is null-safe.- Type Parameters:
T
-type
of the logging events processed by theAppenders
.- Parameters:
appenders
- array ofAppenders
to compose; may be null.- Returns:
- a composition of the array of
Appenders
; returns null if the array is empty. - See Also:
-
compose
public static <T> ch.qos.logback.core.Appender<T> compose(Iterable<ch.qos.logback.core.Appender<T>> appenders) -
getAppenderOne
-
getAppenderTwo
-
setContext
public void setContext(ch.qos.logback.core.Context context) - Specified by:
setContext
in interfacech.qos.logback.core.spi.ContextAware
- Overrides:
setContext
in classch.qos.logback.core.spi.ContextAwareBase
-
getContext
public ch.qos.logback.core.Context getContext()- Specified by:
getContext
in interfacech.qos.logback.core.spi.ContextAware
- Overrides:
getContext
in classch.qos.logback.core.spi.ContextAwareBase
-
append
- Specified by:
append
in classch.qos.logback.core.AppenderBase<T>
-