Wildfire 3.2.4 Javadoc

org.jivesoftware.util.log.output.io.rotate
Class RotateStrategyBySize

java.lang.Object
  extended by org.jivesoftware.util.log.output.io.rotate.RotateStrategyBySize
All Implemented Interfaces:
RotateStrategy

public class RotateStrategyBySize
extends Object
implements RotateStrategy

Rotation stragety based on size written to log file.

Author:
Bernhard Huber

Constructor Summary
RotateStrategyBySize()
          Rotate logs by size.
RotateStrategyBySize(long maxSize)
          Rotate logs by size.
 
Method Summary
 boolean isRotationNeeded(String data, File file)
          Check if now a log rotation is neccessary.
 void reset()
          reset log size written so far.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotateStrategyBySize

public RotateStrategyBySize()
Rotate logs by size. By default do log rotation after writing approx. 1MB of messages


RotateStrategyBySize

public RotateStrategyBySize(long maxSize)
Rotate logs by size.

Parameters:
maxSize - rotate after writing max_size [byte] of messages
Method Detail

reset

public void reset()
reset log size written so far.

Specified by:
reset in interface RotateStrategy

isRotationNeeded

public boolean isRotationNeeded(String data,
                                File file)
Check if now a log rotation is neccessary.

Specified by:
isRotationNeeded in interface RotateStrategy
Parameters:
data - the last message written to the log system
file - the File that we are writing to
Returns:
boolean return true if log rotation is neccessary, else false

Wildfire 3.2.4 Javadoc

Copyright © 2003-2007 Jive Software.