| java.lang.Object org.apache.log.output.io.rotate.RotateStrategyBySize
RotateStrategyBySize | public class RotateStrategyBySize implements RotateStrategy(Code) | | Rotation strategy based on size written to log file.
The strategy will signal that a rotation is needed if the
size goes above a set limit. Due to performance reasons
the limit is not strictly enforced, however, the strategy has
at most an error of the longest single data message written to the
logging system. The error will occur immediately after a rotation,
when the strategy is reset and the data that triggered the
rotation is written. The strategy's internal counter will then
be off with data.length() bytes.
author: Leo Sutic author: Bernhard Huber |
Method Summary | |
public boolean | isRotationNeeded(String data, File file) Check if now a log rotation is neccessary. | public void | reset() Reset log size written so far. |
RotateStrategyBySize | public RotateStrategyBySize()(Code) | | Rotate logs by size.
By default do log rotation before writing approx. 1MB of messages
|
RotateStrategyBySize | public RotateStrategyBySize(long maxSize)(Code) | | Rotate logs by size.
Parameters: maxSize - rotate before writing maxSize [byte] of messages |
isRotationNeeded | public boolean isRotationNeeded(String data, File file)(Code) | | Check if now a log rotation is neccessary.
Parameters: data - the message about to be written to the log system boolean return true if log rotation is neccessary, else false Parameters: file - not used |
reset | public void reset()(Code) | | Reset log size written so far.
|
|
|