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
FieldsFields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.logging.log4j.core.appender.routing.PurgePolicycreatePurgePolicy(int size, String excludePrefix) Create the PurgePolicyvoidinitialize(org.apache.logging.log4j.core.appender.routing.RoutingAppender routingAppender) voidpurge()Delete the oldest appenders (sorted by their last access time) until there are maxSize appenders or less.booleantoString()voidMethods 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
-
Field Details
-
VALUE
- See Also:
-
-
Constructor Details
-
BoundedPurgePolicy
-
-
Method Details
-
initialize
public void initialize(org.apache.logging.log4j.core.appender.routing.RoutingAppender routingAppender) - Specified by:
initializein interfaceorg.apache.logging.log4j.core.appender.routing.PurgePolicy
-
stop
- Specified by:
stopin interfaceorg.apache.logging.log4j.core.LifeCycle2- Overrides:
stopin classorg.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:
purgein interfaceorg.apache.logging.log4j.core.appender.routing.PurgePolicy
-
update
- Specified by:
updatein interfaceorg.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 momentexcludePrefix- a prefix to exclude from eviction, defaults to "${" for missing key.- Returns:
- The Routes container.
-
toString
-