Log4j 1.3alpha-6

org.apache.log4j.rolling
Class SizeBasedTriggeringPolicy

java.lang.Object
  |
  +--org.apache.log4j.rolling.SizeBasedTriggeringPolicy
All Implemented Interfaces:
OptionHandler, TriggeringPolicy

public class SizeBasedTriggeringPolicy
extends java.lang.Object
implements TriggeringPolicy

SizeBasedTriggeringPolicy looks at size of the file being currently written to.

Author:
Ceki Gülcü

Constructor Summary
SizeBasedTriggeringPolicy()
           
 
Method Summary
 void activateOptions()
          Activate the options that were previously set with calls to option setters.
 long getMaxFileSize()
           
 boolean isTriggeringEvent(java.io.File file)
          Should rolllover be triggered at this time?
 void setMaxFileSize(long l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SizeBasedTriggeringPolicy

public SizeBasedTriggeringPolicy()
Method Detail

isTriggeringEvent

public boolean isTriggeringEvent(java.io.File file)
Description copied from interface: TriggeringPolicy
Should rolllover be triggered at this time?

Specified by:
isTriggeringEvent in interface TriggeringPolicy
Parameters:
file - A reference to the currently active log file.

getMaxFileSize

public long getMaxFileSize()

setMaxFileSize

public void setMaxFileSize(long l)

activateOptions

public void activateOptions()
Description copied from interface: OptionHandler
Activate the options that were previously set with calls to option setters.

This allows to defer activiation of the options until all options have been set. This is required for components which have related options that remain ambigous until all are set.

For example, the FileAppender has the File and Append options both of which are ambigous until the other is also set.

Specified by:
activateOptions in interface OptionHandler

Log4j 1.3alpha-6

Copyright 2000-2005 Apache Software Foundation.