public final class SizeBasedTriggeringPolicy extends Object implements TriggeringPolicy, org.apache.log4j.spi.OptionHandler
| Constructor and Description |
|---|
SizeBasedTriggeringPolicy()
Constructs a new instance.
|
SizeBasedTriggeringPolicy(long maxFileSize)
Constructs an new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateOptions()
Prepares policy for use.
|
long |
getMaxFileSize()
Gets rollover threshold size in bytes.
|
boolean |
isTriggeringEvent(org.apache.log4j.Appender appender,
org.apache.log4j.spi.LoggingEvent event,
String file,
long fileLength)
Determines if a rollover may be appropriate at this time.
|
void |
setMaxFileSize(long l)
Sets rollover threshold size in bytes.
|
public SizeBasedTriggeringPolicy()
public SizeBasedTriggeringPolicy(long maxFileSize)
maxFileSize - rollover threshold size in bytes.public boolean isTriggeringEvent(org.apache.log4j.Appender appender,
org.apache.log4j.spi.LoggingEvent event,
String file,
long fileLength)
isTriggeringEvent in interface TriggeringPolicyappender - A reference to the appender.event - A reference to the currently event.file - The filename for the currently active log file.fileLength - Length of the file in bytes.public long getMaxFileSize()
public void setMaxFileSize(long l)
l - new value for rollover threshold size.public void activateOptions()
activateOptions in interface org.apache.log4j.spi.OptionHandlerCopyright © 2013 The Apache Software Foundation. Licensed under the Apache License, Version 2.0
Apache Extras for Apache log4j, Apache log4j and Apache are trademarks of the Apache Software Foundation.