public final class SizeBasedTriggeringPolicy extends java.lang.Object implements TriggeringPolicy, 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(Appender appender,
LoggingEvent event,
java.lang.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(Appender appender, LoggingEvent event, java.lang.String file, long fileLength)
isTriggeringEvent
in interface TriggeringPolicy
appender
- 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 OptionHandler
Copyright © 2006-2019 OPS4J - Open Participation Software for Java. All Rights Reserved.