Package ch.qos.logback.classic.turbo
Class ReconfigureOnChangeFilter
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.classic.turbo.TurboFilter
-
- ch.qos.logback.classic.turbo.ReconfigureOnChangeFilter
-
- All Implemented Interfaces:
ContextAware,LifeCycle
public class ReconfigureOnChangeFilter extends TurboFilter
Reconfigure a LoggerContext when the configuration file changes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classReconfigureOnChangeFilter.ReconfiguringThread
-
Field Summary
Fields Modifier and Type Field Description (package private) ConfigurationWatchListconfigurationWatchListstatic longDEFAULT_REFRESH_PERIODScan for changes in configuration file once every minute.private longinvocationCounterprivate longlastMaskCheck(package private) java.net.URLmainConfigurationURLprivate longmaskprivate static longMASK_DECREASE_THRESHOLDprivate static longMASK_INCREASE_THRESHOLDprivate static intMAX_MASKprotected longnextCheck(package private) longrefreshPeriod-
Fields inherited from class ch.qos.logback.classic.turbo.TurboFilter
start
-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description ReconfigureOnChangeFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanchangeDetected(long now)FilterReplydecide(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.(package private) voiddetachReconfigurationToNewThread()(package private) voiddisableSubsequentReconfiguration()longgetRefreshPeriod()voidsetRefreshPeriod(long refreshPeriod)voidstart()java.lang.StringtoString()private voidupdateMaskIfNecessary(long now)(package private) voidupdateNextCheck(long now)-
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
-
-
-
-
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
-
refreshPeriod
long refreshPeriod
-
mainConfigurationURL
java.net.URL mainConfigurationURL
-
nextCheck
protected volatile long nextCheck
-
configurationWatchList
ConfigurationWatchList configurationWatchList
-
invocationCounter
private long invocationCounter
-
mask
private volatile long mask
-
lastMaskCheck
private volatile long lastMaskCheck
-
MAX_MASK
private static final int MAX_MASK
- See Also:
- Constant Field Values
-
MASK_INCREASE_THRESHOLD
private static final long MASK_INCREASE_THRESHOLD
- See Also:
- Constant Field Values
-
MASK_DECREASE_THRESHOLD
private static final long MASK_DECREASE_THRESHOLD
- See Also:
- Constant Field Values
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceLifeCycle- Overrides:
startin classTurboFilter
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.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:TurboFilterMake a decision based on the multiple parameters passed as arguments. The returned value should be one of,FilterReply.DENY, orFilterReply.NEUTRAL.FilterReply.ACCEPT- Specified by:
decidein classTurboFilter- Returns:
-
updateMaskIfNecessary
private void updateMaskIfNecessary(long now)
-
detachReconfigurationToNewThread
void detachReconfigurationToNewThread()
-
updateNextCheck
void updateNextCheck(long now)
-
changeDetected
protected boolean changeDetected(long now)
-
disableSubsequentReconfiguration
void disableSubsequentReconfiguration()
-
getRefreshPeriod
public long getRefreshPeriod()
-
setRefreshPeriod
public void setRefreshPeriod(long refreshPeriod)
-
-