@Plugin(name="IdlePurgePolicy", category="Core", printObject=true) @Scheduled public class IdlePurgePolicy extends AbstractLifeCycle implements PurgePolicy, Runnable
LifeCycle.State
Constructor and Description |
---|
IdlePurgePolicy(long timeToLive,
ConfigurationScheduler scheduler) |
Modifier and Type | Method and Description |
---|---|
static PurgePolicy |
createPurgePolicy(String timeToLive,
String timeUnit,
Configuration configuration)
Create the PurgePolicy
|
void |
initialize(RoutingAppender routingAppender)
Initialize with routing appender
|
void |
purge()
Purging appenders that were not in use specified time
|
void |
run() |
void |
stop() |
String |
toString() |
void |
update(String key,
LogEvent event) |
equalsImpl, getState, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start
public IdlePurgePolicy(long timeToLive, ConfigurationScheduler scheduler)
public void initialize(RoutingAppender routingAppender)
PurgePolicy
initialize
in interface PurgePolicy
public void stop()
stop
in interface LifeCycle
stop
in class AbstractLifeCycle
public void purge()
purge
in interface PurgePolicy
public void update(String key, LogEvent event)
update
in interface PurgePolicy
@PluginFactory public static PurgePolicy createPurgePolicy(@PluginAttribute(value="timeToLive") String timeToLive, @PluginAttribute(value="timeUnit") String timeUnit, @PluginConfiguration Configuration configuration)
timeToLive
- the number of increments of timeUnit before the Appender should be purged.timeUnit
- the unit of time the timeToLive is expressed in.Copyright © 1999-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.