Module ch.qos.logback.core
Package ch.qos.logback.core.rolling
Interface TimeBasedFileNamingAndTriggeringPolicy<E>
-
- Type Parameters:
E-
- All Superinterfaces:
ContextAware,LifeCycle,TriggeringPolicy<E>
- All Known Implementing Classes:
DefaultTimeBasedFileNamingAndTriggeringPolicy,SizeAndTimeBasedFileNamingAndTriggeringPolicy,SizeAndTimeBasedFNATP,TimeBasedFileNamingAndTriggeringPolicyBase
public interface TimeBasedFileNamingAndTriggeringPolicy<E> extends TriggeringPolicy<E>, ContextAware
This interface lists the set of methods that need to be implemented by triggering policies which are nested within aTimeBasedRollingPolicy.This interface should be considered as an extension of
TimeBasedRollingPolicywith file naming support methods.- Author:
- Ceki Gülcü
- See Also:
TimeBasedFileNamingAndTriggeringPolicyBase
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ArchiveRemovergetArchiveRemover()Return the archive remover appropriate for this instance.StringgetCurrentPeriodsFileNameWithoutCompressionSuffix()Return the current periods file name without the compression suffix.longgetCurrentTime()Return the current time which is usually the value returned by System.currentMillis().StringgetElapsedPeriodsFileName()Return the file name for the elapsed periods file name.voidsetCurrentTime(long now)Set the current time.voidsetTimeBasedRollingPolicy(TimeBasedRollingPolicy<E> tbrp)Set the host/parentTimeBasedRollingPolicy.-
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
getLengthCounter, isTriggeringEvent
-
-
-
-
Method Detail
-
setTimeBasedRollingPolicy
void setTimeBasedRollingPolicy(TimeBasedRollingPolicy<E> tbrp)
Set the host/parentTimeBasedRollingPolicy.- Parameters:
tbrp- parent TimeBasedRollingPolicy
-
getElapsedPeriodsFileName
String getElapsedPeriodsFileName()
Return the file name for the elapsed periods file name.- Returns:
-
getCurrentPeriodsFileNameWithoutCompressionSuffix
String getCurrentPeriodsFileNameWithoutCompressionSuffix()
Return the current periods file name without the compression suffix. This value is equivalent to the active file name.- Returns:
- current period's file name (without compression suffix)
-
getArchiveRemover
ArchiveRemover getArchiveRemover()
Return the archive remover appropriate for this instance.
-
getCurrentTime
long getCurrentTime()
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.- Returns:
- current time value
-
setCurrentTime
void setCurrentTime(long now)
Set the current time. Only unit tests should invoke this method.- Parameters:
now-
-
-