Module ch.qos.logback.core
Package ch.qos.logback.core.rolling
Class SizeAndTimeBasedFileNamingAndTriggeringPolicy<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase<E>
ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
TimeBasedFileNamingAndTriggeringPolicy<E>
,TriggeringPolicy<E>
,ContextAware
,LifeCycle
public class SizeAndTimeBasedFileNamingAndTriggeringPolicy<E>
extends TimeBasedFileNamingAndTriggeringPolicyBase<E>
This class implement
TimeBasedFileNamingAndTriggeringPolicy
interface extending TimeBasedFileNamingAndTriggeringPolicyBase
. This class is intended to be nested
within a SizeAndTimeBasedFileNamingAndTriggeringPolicy
instance. However, it can also be instantiated directly for testing purposes.- Author:
- Ceki Gülcü
-
Field Summary
Fields inherited from class ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase
archiveRemover, artificialCurrentTime, atomicNextCheck, dateInCurrentPeriod, elapsedPeriodsFileName, errorFree, rc, started, tbrp
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
ConstructorDescriptionSizeAndTimeBasedFileNamingAndTriggeringPolicy
(ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy.Usage usage) -
Method Summary
Modifier and TypeMethodDescriptionprotected ArchiveRemover
Return the current periods file name without the compression suffix.Return theLengthCounter
instance associated with this triggering policy.boolean
isTriggeringEvent
(File activeFile, E event) Should roll-over be triggered at this time?void
setCheckIncrement
(Duration checkIncrement) void
setMaxFileSize
(FileSize aMaxFileSize) void
start()
Methods inherited from class ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase
computeNextCheck, getArchiveRemover, getCurrentTime, getElapsedPeriodsFileName, isErrorFree, isStarted, setCurrentTime, setDateInCurrentPeriod, setTimeBasedRollingPolicy, stop, withErrors
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
lengthCounter
-
-
Constructor Details
-
SizeAndTimeBasedFileNamingAndTriggeringPolicy
-
SizeAndTimeBasedFileNamingAndTriggeringPolicy
public SizeAndTimeBasedFileNamingAndTriggeringPolicy(ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy.Usage usage)
-
-
Method Details
-
start
-
createArchiveRemover
-
isTriggeringEvent
Description copied from interface:TriggeringPolicy
Should 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.
-
getCheckIncrement
-
setCheckIncrement
-
getCurrentPeriodsFileNameWithoutCompressionSuffix
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicy
Return the current periods file name without the compression suffix. This value is equivalent to the active file name.- Specified by:
getCurrentPeriodsFileNameWithoutCompressionSuffix
in interfaceTimeBasedFileNamingAndTriggeringPolicy<E>
- Overrides:
getCurrentPeriodsFileNameWithoutCompressionSuffix
in classTimeBasedFileNamingAndTriggeringPolicyBase<E>
- Returns:
- current period's file name (without compression suffix)
-
setMaxFileSize
-
getLengthCounter
Description copied from interface:TriggeringPolicy
Return theLengthCounter
instance associated with this triggering policy. The returned value may be null.- Returns:
- a LengthCounter instance, may be null
-