Class SizeBasedTriggeringPolicy<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.rolling.TriggeringPolicyBase<E>
ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy<E>
- All Implemented Interfaces:
TriggeringPolicy<E>, ContextAware, LifeCycle
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
FieldsModifier and TypeFieldDescriptionstatic final longThe default maximum file size.static final StringFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisTriggeringEvent(File activeFile, E event) Should roll-over be triggered at this time?voidsetCheckIncrement(Duration checkIncrement) voidsetMaxFileSize(FileSize aMaxFileSize) voidstart()Methods inherited from class TriggeringPolicyBase
isStarted, stopMethods inherited from class ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TriggeringPolicy
getLengthCounter
-
Field Details
-
SEE_SIZE_FORMAT
- See Also:
-
DEFAULT_MAX_FILE_SIZE
-
-
Constructor Details
-
SizeBasedTriggeringPolicy
public SizeBasedTriggeringPolicy()
-
-
Method Details
-
start
-
isTriggeringEvent
Description copied from interface:TriggeringPolicyShould roll-over be triggered at this time?- Parameters:
activeFile- A reference to the currently active log file.event- A reference to the current event.- Returns:
- true if a roll-over should occur.
-
getMaxFileSize
-
setMaxFileSize
-
getCheckIncrement
-
setCheckIncrement
-