Runnable, PurgePolicy, LifeCycle, LifeCycle2@Plugin(name="IdlePurgePolicy", category="Core", printObject=true) @Scheduled public class IdlePurgePolicy extends AbstractLifeCycle implements PurgePolicy, Runnable
LifeCycle.StateDEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER| Constructor | Description |
|---|---|
IdlePurgePolicy(long timeToLive,
long checkInterval,
ConfigurationScheduler scheduler) |
| Modifier and Type | Method | Description |
|---|---|---|
static PurgePolicy |
createPurgePolicy(String timeToLive,
String checkInterval,
String timeUnit,
Configuration configuration) |
Create the PurgePolicy
|
void |
initialize(RoutingAppender routingAppender) |
Initializes with routing appender
|
void |
purge() |
Purging appenders that were not in use specified time
|
void |
run() |
|
boolean |
stop(long timeout,
TimeUnit timeUnit) |
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current
thread is interrupted, whichever happens first.
|
String |
toString() |
|
void |
update(String key,
LogEvent event) |
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, start, stop, stoppublic IdlePurgePolicy(long timeToLive,
long checkInterval,
ConfigurationScheduler scheduler)
public void initialize(RoutingAppender routingAppender)
PurgePolicyinitialize in interface PurgePolicypublic boolean stop(long timeout,
TimeUnit timeUnit)
LifeCycle2stop in interface LifeCycle2stop in class AbstractLifeCycletimeout - the maximum time to waittimeUnit - the time unit of the timeout argumentpublic void purge()
purge in interface PurgePolicypublic void update(String key, LogEvent event)
update in interface PurgePolicy@PluginFactory public static PurgePolicy createPurgePolicy(@PluginAttribute("timeToLive") String timeToLive, @PluginAttribute("checkInterval") String checkInterval, @PluginAttribute("timeUnit") String timeUnit, @PluginConfiguration Configuration configuration)
timeToLive - the number of increments of timeUnit before the Appender should be purged.checkInterval - when all appenders purged, the number of increments of timeUnit to check if any appenders appearedtimeUnit - the unit of time the timeToLive and the checkInterval is expressed in.Copyright © 1999-2018. 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.