org.apache.log.output.io.rotate
Class RotateStrategyByTime
java.lang.Object
org.apache.log.output.io.rotate.RotateStrategyByTime
- RotateStrategy
public class RotateStrategyByTime
extends java.lang.Object
rotation stragety based when log writting started.
boolean | isRotationNeeded(String data, File file) - Check if now a log rotation is neccessary.
|
void | reset() - reset interval history counters.
|
RotateStrategyByTime
public RotateStrategyByTime()
Rotate logs by time.
By default do log rotation every 24 hours
RotateStrategyByTime
public RotateStrategyByTime(long timeInterval)
Rotate logs by time.
timeInterval
- rotate before time-interval [ms] has expired
isRotationNeeded
public boolean isRotationNeeded(String data,
File file)
Check if now a log rotation is neccessary.
If
(current_time - m_startingTime) / m_timeInterval > m_currentRotation
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