Top Description Fields Constructors Methods
ch.qos.logback.core.rolling

public Class SizeBasedTriggeringPolicy<E>

extends TriggeringPolicyBase<E>
Class Inheritance
Imports
java.io.File, ch.qos.logback.core.util.Duration, .FileSize, .DefaultInvocationGate, .InvocationGate, .SimpleInvocationGate

SizeBasedTriggeringPolicy looks at size of the file being currently written to. If it grows bigger than the specified size, the FileAppender using the SizeBasedTriggeringPolicy rolls the file and creates a new one. For more information about this policy, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#SizeBasedTriggeringPolicy
Author
Ceki Gülcü

Field Summary

Modifier and TypeField and Description
pack-priv Duration
public static final long
DEFAULT_MAX_FILE_SIZE

The default maximum file size.

pack-priv InvocationGate
pack-priv FileSize
public static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Duration
public FileSize
public boolean
isTriggeringEvent(final File
A reference to the currently active log file.
activeFile
,
final E
A reference to the current event.
event
)

Implements ch.qos.logback.core.rolling.TriggeringPolicy.isTriggeringEvent.

Should roll-over be triggered at this time?
public void
setCheckIncrement(Duration checkIncrement)

public void
setMaxFileSize(FileSize aMaxFileSize)

public void
Inherited from ch.qos.logback.core.rolling.TriggeringPolicyBase:
isStartedstop

Field Detail

checkIncrementback to summary
pack-priv Duration checkIncrement
DEFAULT_MAX_FILE_SIZEback to summary
public static final long DEFAULT_MAX_FILE_SIZE

The default maximum file size.

invocationGateback to summary
pack-priv InvocationGate invocationGate
maxFileSizeback to summary
pack-priv FileSize maxFileSize
SEE_SIZE_FORMATback to summary
public static final String SEE_SIZE_FORMAT

Constructor Detail

SizeBasedTriggeringPolicyback to summary
public SizeBasedTriggeringPolicy()

Method Detail

getCheckIncrementback to summary
public Duration getCheckIncrement()
getMaxFileSizeback to summary
public FileSize getMaxFileSize()
isTriggeringEventback to summary
public boolean isTriggeringEvent(final File activeFile, final E event)

Implements ch.qos.logback.core.rolling.TriggeringPolicy.isTriggeringEvent.

Doc from ch.qos.logback.core.rolling.TriggeringPolicy.isTriggeringEvent.

Should roll-over be triggered at this time?

Parameters
activeFile:File

A reference to the currently active log file.

event:E

A reference to the current event.

Returns:boolean

true if a roll-over should occur.

setCheckIncrementback to summary
public void setCheckIncrement(Duration checkIncrement)
setMaxFileSizeback to summary
public void setMaxFileSize(FileSize aMaxFileSize)
startback to summary
public void start()

Overrides ch.qos.logback.core.rolling.TriggeringPolicyBase.start.

Implements ch.qos.logback.core.spi.LifeCycle.start.