Class ReconfigureOnChangeFilter

All Implemented Interfaces:
ContextAware, LifeCycle

public class ReconfigureOnChangeFilter extends TurboFilter
Reconfigure a LoggerContext when the configuration file changes.
  • Field Details

    • DEFAULT_REFRESH_PERIOD

      public static final long DEFAULT_REFRESH_PERIOD
      Scan 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 interface LifeCycle
      Overrides:
      start in class TurboFilter
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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, FilterReply.NEUTRAL, or FilterReply.ACCEPT.
      Specified by:
      decide in class TurboFilter
      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)