Module ch.qos.logback.core
Package ch.qos.logback.core.rolling
Class TimeBasedFileNamingAndTriggeringPolicyBase<E>
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase<E>
- Type Parameters:
E-
- All Implemented Interfaces:
TimeBasedFileNamingAndTriggeringPolicy<E>,TriggeringPolicy<E>,ContextAware,LifeCycle
- Direct Known Subclasses:
DefaultTimeBasedFileNamingAndTriggeringPolicy,SizeAndTimeBasedFileNamingAndTriggeringPolicy
public abstract class TimeBasedFileNamingAndTriggeringPolicyBase<E>
extends ContextAwareBase
implements TimeBasedFileNamingAndTriggeringPolicy<E>
Base implementation of
TimeBasedFileNamingAndTriggeringPolicy.
See also derived classes DefaultTimeBasedFileNamingAndTriggeringPolicy and
SizeAndTimeBasedFileNamingAndTriggeringPolicy.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArchiveRemoverprotected longprotected AtomicLongprotected Instantprotected Stringprotected booleanprotected RollingCalendarprotected booleanprotected TimeBasedRollingPolicy<E> Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longcomputeNextCheck(long timestamp) Return the archive remover appropriate for this instance.Return the current periods file name without the compression suffix.longReturn the current time which is usually the value returned by System.currentMillis().Return the file name for the elapsed periods file name.protected booleanbooleanvoidsetCurrentTime(long timeInMillis) Set the current time.protected voidsetDateInCurrentPeriod(long timestamp) voidSet the host/parentTimeBasedRollingPolicy.voidstart()voidstop()protected voidMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContextMethods inherited from interface ch.qos.logback.core.rolling.TriggeringPolicy
getLengthCounter, isTriggeringEvent
-
Field Details
-
tbrp
-
archiveRemover
-
elapsedPeriodsFileName
-
rc
-
artificialCurrentTime
-
atomicNextCheck
-
dateInCurrentPeriod
-
started
-
errorFree
-
-
Constructor Details
-
TimeBasedFileNamingAndTriggeringPolicyBase
-
-
Method Details
-
isStarted
-
start
-
stop
-
computeNextCheck
-
getElapsedPeriodsFileName
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicyReturn the file name for the elapsed periods file name.- Specified by:
getElapsedPeriodsFileNamein interfaceTimeBasedFileNamingAndTriggeringPolicy<E>- Returns:
-
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>- Returns:
- current period's file name (without compression suffix)
-
setDateInCurrentPeriod
-
setCurrentTime
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicySet the current time. Only unit tests should invoke this method.- Specified by:
setCurrentTimein interfaceTimeBasedFileNamingAndTriggeringPolicy<E>- Parameters:
timeInMillis-
-
getCurrentTime
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicyReturn the current time which is usually the value returned by System.currentMillis(). However, for testing purposed this value may be different than the real time.- Specified by:
getCurrentTimein interfaceTimeBasedFileNamingAndTriggeringPolicy<E>- Returns:
- current time value
-
setTimeBasedRollingPolicy
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicySet the host/parentTimeBasedRollingPolicy.- Specified by:
setTimeBasedRollingPolicyin interfaceTimeBasedFileNamingAndTriggeringPolicy<E>- Parameters:
_tbrp- parent TimeBasedRollingPolicy
-
getArchiveRemover
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicyReturn the archive remover appropriate for this instance.- Specified by:
getArchiveRemoverin interfaceTimeBasedFileNamingAndTriggeringPolicy<E>
-
withErrors
-
isErrorFree
-