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
- Direct Known Subclasses:
SizeAndTimeBasedFNATP
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.
SizeAndTimeBasedFNATP class was renamed as SizeAndTimeBasedFileNamingAndTriggeringPolicy
in version 1.5.8.
- Since:
- 1.5.8
- Author:
- Ceki Gülcü
-
Field Summary
FieldsFields inherited from class TimeBasedFileNamingAndTriggeringPolicyBase
archiveRemover, artificialCurrentTime, atomicNextCheck, dateInCurrentPeriod, elapsedPeriodsFileName, errorFree, rc, started, tbrp, zoneIdFields inherited from class ContextAwareBase
context -
Constructor Summary
ConstructorsConstructorDescriptionSizeAndTimeBasedFileNamingAndTriggeringPolicy(ch.qos.logback.core.rolling.SizeAndTimeBasedFileNamingAndTriggeringPolicy.Usage usage) -
Method Summary
Modifier and TypeMethodDescriptionprotected ArchiveRemoverReturn the current periods file name without the compression suffix.Return theLengthCounterinstance associated with this triggering policy.booleanisTriggeringEvent(File activeFile, E event) Should roll-over be triggered at this time?voidsetCheckIncrement(Duration checkIncrement) voidsetMaxFileSize(FileSize aMaxFileSize) voidstart()Methods inherited from class TimeBasedFileNamingAndTriggeringPolicyBase
computeNextCheck, getArchiveRemover, getCurrentTime, getElapsedPeriodsFileName, isErrorFree, isStarted, setCurrentTime, setDateInCurrentPeriod, setTimeBasedRollingPolicy, stop, withErrorsMethods 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 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: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.
-
getCheckIncrement
-
setCheckIncrement
-
getCurrentPeriodsFileNameWithoutCompressionSuffix
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicyReturn the current periods file name without the compression suffix. This value is equivalent to the active file name.- Specified by:
getCurrentPeriodsFileNameWithoutCompressionSuffixin interfaceTimeBasedFileNamingAndTriggeringPolicy<E>- Overrides:
getCurrentPeriodsFileNameWithoutCompressionSuffixin classTimeBasedFileNamingAndTriggeringPolicyBase<E>- Returns:
- current period's file name (without compression suffix)
-
setMaxFileSize
-
getLengthCounter
Description copied from interface:TriggeringPolicyReturn theLengthCounterinstance associated with this triggering policy. The returned value may be null.- Returns:
- a LengthCounter instance, may be null
-