org.apache.log.output.io.rotate
public class RotateStrategyByTime extends Object implements RotateStrategy
Modifier and Type | Field and Description |
---|---|
private long |
m_currentRotation |
private long |
m_startingTime |
private long |
m_timeInterval |
Constructor and Description |
---|
RotateStrategyByTime()
Rotate logs by time.
|
RotateStrategyByTime(long timeInterval)
Rotate logs by time.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isRotationNeeded(String data,
File file)
Check if now a log rotation is neccessary.
|
void |
reset()
reset interval history counters.
|
private long m_timeInterval
private long m_startingTime
private long m_currentRotation
public RotateStrategyByTime()
public RotateStrategyByTime(long timeInterval)
timeInterval
- rotate before time-interval [ms] has expiredpublic void reset()
reset
in interface RotateStrategy
public boolean isRotationNeeded(String data, File file)
(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 usedCopyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.