Class OnPrintStreamStatusListenerBase

java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.status.OnPrintStreamStatusListenerBase
All Implemented Interfaces:
ContextAware, LifeCycle, StatusListener
Direct Known Subclasses:
OnConsoleStatusListener, OnErrorConsoleStatusListener

public abstract class OnPrintStreamStatusListenerBase extends ContextAwareBase implements StatusListener, LifeCycle
Print all new incoming status messages on the on the designated PrintStream.
  • Field Details

    • isStarted

      boolean isStarted
    • DEFAULT_RETROSPECTIVE

      static final long DEFAULT_RETROSPECTIVE
      See Also:
    • retrospectiveThresold

      long retrospectiveThresold
    • prefix

      String prefix
      The prefix to place before each status message
      Since:
      1.1.10
  • Constructor Details

    • OnPrintStreamStatusListenerBase

      public OnPrintStreamStatusListenerBase()
  • Method Details

    • getPrintStream

      protected abstract PrintStream getPrintStream()
      The PrintStream used by derived classes
      Returns:
    • print

      private void print(Status status)
    • addStatusEvent

      public void addStatusEvent(Status status)
      Specified by:
      addStatusEvent in interface StatusListener
    • retrospectivePrint

      private void retrospectivePrint()
      Print status messages retrospectively
    • isElapsedTimeLongerThanThreshold

      private boolean isElapsedTimeLongerThanThreshold(long now, long timestamp)
    • start

      public void start()
      Invoking the start method can cause the instance to print status messages created less than value of retrospectiveThresold.
      Specified by:
      start in interface LifeCycle
    • getPrefix

      public String getPrefix()
    • setPrefix

      public void setPrefix(String prefix)
    • setRetrospective

      public void setRetrospective(long retrospective)
    • getRetrospective

      public long getRetrospective()
    • stop

      public void stop()
      Specified by:
      stop in interface LifeCycle
    • isStarted

      public boolean isStarted()
      Specified by:
      isStarted in interface LifeCycle