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.PurgePolicyPolicy is purging appenders that were not in use specified time, or sooner if there are too many active appenders
-
-
Constructor Summary
Constructors Constructor Description BoundedPurgePolicy(int maxSize, String excludePrefix)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.booleanstop(long timeout, TimeUnit timeUnit)StringtoString()voidupdate(String key, org.apache.logging.log4j.core.LogEvent event)
-
-
-
Field Detail
-
VALUE
public static final String VALUE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BoundedPurgePolicy
public BoundedPurgePolicy(int maxSize, String excludePrefix)
-
-
Method Detail
-
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
public boolean stop(long timeout, TimeUnit timeUnit)- 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
public void update(String key, org.apache.logging.log4j.core.LogEvent event)
- 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.
-
-