Class BoundedPurgePolicy

java.lang.Object
org.apache.logging.log4j.core.AbstractLifeCycle
org.infinispan.commons.logging.log4j.BoundedPurgePolicy
All Implemented Interfaces:
org.apache.logging.log4j.core.appender.routing.PurgePolicy, org.apache.logging.log4j.core.LifeCycle, org.apache.logging.log4j.core.LifeCycle2

@Plugin(name="BoundedPurgePolicy", category="Core", printObject=true) public class BoundedPurgePolicy extends org.apache.logging.log4j.core.AbstractLifeCycle implements org.apache.logging.log4j.core.appender.routing.PurgePolicy
Policy is purging appenders that were not in use specified time, or sooner if there are too many active appenders
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle

    org.apache.logging.log4j.core.LifeCycle.State
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle

    DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
  • Constructor Summary

    Constructors
    Constructor
    Description
    BoundedPurgePolicy(int maxSize, String excludePrefix)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.apache.logging.log4j.core.appender.routing.PurgePolicy
    createPurgePolicy(int size, String excludePrefix)
    Create the PurgePolicy
    void
    initialize(org.apache.logging.log4j.core.appender.routing.RoutingAppender routingAppender)
     
    void
    Delete the oldest appenders (sorted by their last access time) until there are maxSize appenders or less.
    boolean
    stop(long timeout, TimeUnit timeUnit)
     
     
    void
    update(String key, org.apache.logging.log4j.core.LogEvent event)
     

    Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle

    equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • BoundedPurgePolicy

      public BoundedPurgePolicy(int maxSize, String excludePrefix)
  • Method Details

    • initialize

      public void initialize(org.apache.logging.log4j.core.appender.routing.RoutingAppender routingAppender)
      Specified by:
      initialize in interface org.apache.logging.log4j.core.appender.routing.PurgePolicy
    • stop

      public boolean stop(long timeout, TimeUnit timeUnit)
      Specified by:
      stop in interface org.apache.logging.log4j.core.LifeCycle2
      Overrides:
      stop in class org.apache.logging.log4j.core.AbstractLifeCycle
    • purge

      public void purge()
      Delete the oldest appenders (sorted by their last access time) until there are maxSize appenders or less.
      Specified by:
      purge in interface org.apache.logging.log4j.core.appender.routing.PurgePolicy
    • update

      public void update(String key, org.apache.logging.log4j.core.LogEvent event)
      Specified by:
      update in interface org.apache.logging.log4j.core.appender.routing.PurgePolicy
    • createPurgePolicy

      @PluginFactory public static org.apache.logging.log4j.core.appender.routing.PurgePolicy createPurgePolicy(@PluginAttribute("size") int size, @PluginAttribute(value="excludePrefix",defaultString="${") String excludePrefix)
      Create the PurgePolicy
      Parameters:
      size - the maximum number of appenders to keep active at any moment
      excludePrefix - a prefix to exclude from eviction, defaults to "${" for missing key.
      Returns:
      The Routes container.
    • toString

      public String toString()
      Overrides:
      toString in class Object