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
Reconfigure a LoggerContext when the configuration file changes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) ConfigurationWatchList
static final long
Scan for changes in configuration file once every minute.private long
private long
(package private) URL
private long
private static final long
private static final long
private static final int
protected long
(package private) long
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
changeDetected
(long now) decide
(org.slf4j.Marker marker, Logger logger, Level level, String format, Object[] params, Throwable t) Make a decision based on the multiple parameters passed as arguments.(package private) void
(package private) void
long
void
setRefreshPeriod
(long refreshPeriod) void
start()
toString()
private void
updateMaskIfNecessary
(long now) (package private) void
updateNextCheck
(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 Details
-
DEFAULT_REFRESH_PERIOD
public static final long DEFAULT_REFRESH_PERIODScan for changes in configuration file once every minute.- See Also:
-
refreshPeriod
long refreshPeriod -
mainConfigurationURL
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:
-
MASK_INCREASE_THRESHOLD
private static final long MASK_INCREASE_THRESHOLD- See Also:
-
MASK_DECREASE_THRESHOLD
private static final long MASK_DECREASE_THRESHOLD- See Also:
-
-
Constructor Details
-
ReconfigureOnChangeFilter
public ReconfigureOnChangeFilter()
-
-
Method Details
-
start
public void start()- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classTurboFilter
-
toString
-
decide
public FilterReply decide(org.slf4j.Marker marker, Logger logger, Level level, String format, Object[] params, 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
, orFilterReply.NEUTRAL
.FilterReply.ACCEPT
- Specified by:
decide
in 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)
-