org.apache.log.output.io.rotate
Class RotateStrategyByTimeOfDay
java.lang.Object
org.apache.log.output.io.rotate.RotateStrategyByTimeOfDay
- RotateStrategy
public class RotateStrategyByTimeOfDay
extends java.lang.Object
Rotation stragety based on a specific time of day.
boolean | isRotationNeeded(String data, File file) - Check if now a log rotation is neccessary.
|
void | reset() - reset interval history counters.
|
RotateStrategyByTimeOfDay
public RotateStrategyByTimeOfDay()
Rotate logs at specific time of day.
By default do log rotation at 00:00:00 every day.
RotateStrategyByTimeOfDay
public RotateStrategyByTimeOfDay(long time)
Rotate logs at specific time of day.
time
- Offset in milliseconds into the day to perform the log rotation.
isRotationNeeded
public boolean isRotationNeeded(String data,
File file)
Check if now a log rotation is neccessary.
If the time of the current rotation + 24 hours is less than the current time.
If not then a rotation is needed.
- isRotationNeeded in interface RotateStrategy
data
- the last message written to the log systemfile
- not used
- boolean return true if log rotation is neccessary, else false