ch.qos.logback.classic.turbo
Class ReconfigureOnChangeFilter

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.classic.turbo.TurboFilter
          extended by ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter
All Implemented Interfaces:
ContextAware, LifeCycle

public class ReconfigureOnChangeFilter
extends TurboFilter

Reconfigure a LoggerContext when the configuration file changes.

Author:
Ceki Gulcu

Field Summary
static long DEFAULT_REFRESH_PERIOD
          Scan for changes in configuration file once every minute.
protected  long nextCheck
           
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
ReconfigureOnChangeFilter()
           
 
Method Summary
protected  boolean changeDetected()
           
 FilterReply decide(org.slf4j.Marker marker, Logger logger, Level level, java.lang.String format, java.lang.Object[] params, java.lang.Throwable t)
          Make a decision based on the multiple parameters passed as arguments.
 long getRefreshPeriod()
           
 void setRefreshPeriod(long refreshPeriod)
           
 void start()
           
 java.lang.String toString()
           
 
Methods inherited from class ch.qos.logback.classic.turbo.TurboFilter
getName, isStarted, setName, stop
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_REFRESH_PERIOD

public static final long DEFAULT_REFRESH_PERIOD
Scan for changes in configuration file once every minute.

See Also:
Constant Field Values

nextCheck

protected volatile long nextCheck
Constructor Detail

ReconfigureOnChangeFilter

public ReconfigureOnChangeFilter()
Method Detail

start

public void start()
Specified by:
start in interface LifeCycle
Overrides:
start in class TurboFilter

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

decide

public FilterReply decide(org.slf4j.Marker marker,
                          Logger logger,
                          Level level,
                          java.lang.String format,
                          java.lang.Object[] params,
                          java.lang.Throwable t)
Description copied from class: TurboFilter
Make a decision based on the multiple parameters passed as arguments. The returned value should be one of FilterReply.DENY, FilterReply.NEUTRAL, or FilterReply.ACCEPT.

Specified by:
decide in class TurboFilter
Returns:

changeDetected

protected boolean changeDetected()

getRefreshPeriod

public long getRefreshPeriod()

setRefreshPeriod

public void setRefreshPeriod(long refreshPeriod)