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
    Modifier and Type
    Field
    Description
    protected static final String
     

    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 Type
    Method
    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(Iterable<ch.qos.logback.core.Appender<T>> appenders)
    Composes the Iterable of Appenders into a CompositeAppender.
    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

  • 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 two Appender objects into a Composite Appender.
      Type Parameters:
      T - type of Appender to compose.
      Parameters:
      one - first Appender to compose.
      two - second Appender to compose.
      Returns:
      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.
      See Also:
      • Appender
    • compose

      public static <T> ch.qos.logback.core.Appender<T> compose(ch.qos.logback.core.Appender<T>... appenders)
      Composes an array of Appenders into a CompositeAppender. This operation is null-safe.
      Type Parameters:
      T - type of the logging events processed by the Appenders.
      Parameters:
      appenders - array of Appenders 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)
      Composes the Iterable of Appenders into a CompositeAppender. This operation is null-safe.
      Type Parameters:
      T - type of the logging events processed by the Appenders.
      Parameters:
      appenders - Iterable of Appenders to compose; may be null.
      Returns:
      a composition of the Iterable of Appenders; returns null if the Iterable is null or empty.
      See Also:
    • getAppenderOne

      protected ch.qos.logback.core.Appender<T> getAppenderOne()
    • getAppenderTwo

      protected ch.qos.logback.core.Appender<T> getAppenderTwo()
    • setContext

      public void setContext(ch.qos.logback.core.Context context)
      Specified by:
      setContext in interface ch.qos.logback.core.spi.ContextAware
      Overrides:
      setContext in class ch.qos.logback.core.spi.ContextAwareBase
    • getContext

      public ch.qos.logback.core.Context getContext()
      Specified by:
      getContext in interface ch.qos.logback.core.spi.ContextAware
      Overrides:
      getContext in class ch.qos.logback.core.spi.ContextAwareBase
    • append

      protected void append(T eventObject)
      Specified by:
      append in class ch.qos.logback.core.AppenderBase<T>