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
,SizeAndTimeBasedFNATP
public abstract class TimeBasedFileNamingAndTriggeringPolicyBase<E>
extends ContextAwareBase
implements TimeBasedFileNamingAndTriggeringPolicy<E>
Base implementation of
TimeBasedFileNamingAndTriggeringPolicy
.
See also derived classes DefaultTimeBasedFileNamingAndTriggeringPolicy
and
SizeAndTimeBasedFNATP
.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ArchiveRemover
protected long
protected AtomicLong
protected Instant
protected String
protected boolean
protected RollingCalendar
protected boolean
protected TimeBasedRollingPolicy
<E> Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
computeNextCheck
(long timestamp) Return the archive remover appropriate for this instance.Return the current periods file name without the compression suffix.long
Return the current time which is usually the value returned by System.currentMillis().Return the file name for the elapsed periods file name.protected boolean
boolean
void
setCurrentTime
(long timeInMillis) Set the current time.protected void
setDateInCurrentPeriod
(long timestamp) void
Set the host/parentTimeBasedRollingPolicy
.void
start()
void
stop()
protected void
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
Methods inherited from interface ch.qos.logback.core.rolling.TriggeringPolicy
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:TimeBasedFileNamingAndTriggeringPolicy
Return the file name for the elapsed periods file name.- Specified by:
getElapsedPeriodsFileName
in interfaceTimeBasedFileNamingAndTriggeringPolicy<E>
- Returns:
-
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>
- Returns:
- current period's file name (without compression suffix)
-
setDateInCurrentPeriod
-
setCurrentTime
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicy
Set the current time. Only unit tests should invoke this method.- Specified by:
setCurrentTime
in interfaceTimeBasedFileNamingAndTriggeringPolicy<E>
- Parameters:
timeInMillis
-
-
getCurrentTime
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicy
Return 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:
getCurrentTime
in interfaceTimeBasedFileNamingAndTriggeringPolicy<E>
- Returns:
- current time value
-
setTimeBasedRollingPolicy
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicy
Set the host/parentTimeBasedRollingPolicy
.- Specified by:
setTimeBasedRollingPolicy
in interfaceTimeBasedFileNamingAndTriggeringPolicy<E>
- Parameters:
_tbrp
- parent TimeBasedRollingPolicy
-
getArchiveRemover
Description copied from interface:TimeBasedFileNamingAndTriggeringPolicy
Return the archive remover appropriate for this instance.- Specified by:
getArchiveRemover
in interfaceTimeBasedFileNamingAndTriggeringPolicy<E>
-
withErrors
-
isErrorFree
-