Class TimeBasedTriggeringPolicy
- java.lang.Object
-
- org.apache.logging.log4j.core.AbstractLifeCycle
-
- org.apache.logging.log4j.core.appender.rolling.AbstractTriggeringPolicy
-
- org.apache.logging.log4j.core.appender.rolling.TimeBasedTriggeringPolicy
-
- All Implemented Interfaces:
TriggeringPolicy
,LifeCycle
,LifeCycle2
@Plugin(name="TimeBasedTriggeringPolicy", category="Core", printObject=true) public final class TimeBasedTriggeringPolicy extends AbstractTriggeringPolicy
Rolls a file over based on time.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeBasedTriggeringPolicy.Builder
-
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static TimeBasedTriggeringPolicy
createPolicy(String interval, String modulate)
Deprecated.UsenewBuilder()
.int
getInterval()
long
getNextRolloverMillis()
void
initialize(RollingFileManager aManager)
Initializes the policy.boolean
isTriggeringEvent(LogEvent event)
Determines whether a rollover should occur.static TimeBasedTriggeringPolicy.Builder
newBuilder()
String
toString()
-
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, stop
-
-
-
-
Method Detail
-
getInterval
public int getInterval()
-
getNextRolloverMillis
public long getNextRolloverMillis()
-
initialize
public void initialize(RollingFileManager aManager)
Initializes the policy.- Parameters:
aManager
- The RollingFileManager.
-
isTriggeringEvent
public boolean isTriggeringEvent(LogEvent event)
Determines whether a rollover should occur.- Parameters:
event
- A reference to the currently event.- Returns:
- true if a rollover should occur.
-
createPolicy
@Deprecated public static TimeBasedTriggeringPolicy createPolicy(@PluginAttribute("interval") String interval, @PluginAttribute("modulate") String modulate)
Deprecated.UsenewBuilder()
.Creates a TimeBasedTriggeringPolicy.- Parameters:
interval
- The interval between rollovers.modulate
- If true the time will be rounded to occur on a boundary aligned with the increment.- Returns:
- a TimeBasedTriggeringPolicy.
-
newBuilder
@PluginBuilderFactory public static TimeBasedTriggeringPolicy.Builder newBuilder()
-
-