Package org.apache.log.output.io.rotate
Class RotateStrategyByTime
- java.lang.Object
-
- org.apache.log.output.io.rotate.RotateStrategyByTime
-
- All Implemented Interfaces:
RotateStrategy
public class RotateStrategyByTime extends java.lang.Object implements RotateStrategy
rotation stragety based when log writting started.- Author:
- Bernhard Huber
-
-
Field Summary
Fields Modifier and Type Field Description private longm_currentRotationprivate longm_startingTimeprivate longm_timeInterval
-
Constructor Summary
Constructors Constructor Description RotateStrategyByTime()Rotate logs by time.RotateStrategyByTime(long timeInterval)Rotate logs by time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisRotationNeeded(java.lang.String data, java.io.File file)Check if now a log rotation is neccessary.voidreset()reset interval history counters.
-
-
-
Method Detail
-
reset
public void reset()
reset interval history counters.- Specified by:
resetin interfaceRotateStrategy
-
isRotationNeeded
public boolean isRotationNeeded(java.lang.String data, java.io.File file)Check if now a log rotation is neccessary. If(current_time - m_startingTime) / m_timeInterval > m_currentRotationrotation is needed.- Specified by:
isRotationNeededin interfaceRotateStrategy- Parameters:
data- the last message written to the log systemfile- not used- Returns:
- boolean return true if log rotation is neccessary, else false
-
-