RotateStrategy
public class RotateStrategyByTime extends java.lang.Object implements RotateStrategy
Modifier and Type | Field | Description |
---|---|---|
private long |
m_currentRotation |
|
private long |
m_startingTime |
|
private long |
m_timeInterval |
Constructor | Description |
---|---|
RotateStrategyByTime() |
Rotate logs by time.
|
RotateStrategyByTime(long timeInterval) |
Rotate logs by time.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
isRotationNeeded(java.lang.String data,
java.io.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(java.lang.String data, java.io.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.