Package ch.qos.logback.core.rolling
Class SizeAndTimeBasedFNATP<E>
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase<E>
-
- ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP<E>
-
- All Implemented Interfaces:
TimeBasedFileNamingAndTriggeringPolicy<E>,TriggeringPolicy<E>,ContextAware,LifeCycle
public class SizeAndTimeBasedFNATP<E> extends TimeBasedFileNamingAndTriggeringPolicyBase<E>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classSizeAndTimeBasedFNATP.Usage
-
Field Summary
Fields Modifier and Type Field Description (package private) intcurrentPeriodsCounter(package private) InvocationGateinvocationGate(package private) FileSizemaxFileSize(package private) static java.lang.StringMISSING_DATE_TOKEN(package private) static java.lang.StringMISSING_INT_TOKEN(package private) longnextSizeCheckprivate SizeAndTimeBasedFNATP.Usageusage-
Fields inherited from class ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase
archiveRemover, artificialCurrentTime, dateInCurrentPeriod, elapsedPeriodsFileName, errorFree, nextCheck, rc, started, tbrp
-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description SizeAndTimeBasedFNATP()SizeAndTimeBasedFNATP(SizeAndTimeBasedFNATP.Usage usage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidcomputeCurrentPeriodsHighestCounterValue(java.lang.String stemRegex)protected ArchiveRemovercreateArchiveRemover()java.lang.StringgetCurrentPeriodsFileNameWithoutCompressionSuffix()Return the current periods file name without the compression suffix.booleanisTriggeringEvent(java.io.File activeFile, E event)Should roll-over be triggered at this time?voidsetMaxFileSize(FileSize aMaxFileSize)voidstart()private booleanvalidateDateAndIntegerTokens()-
Methods inherited from class ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase
computeNextCheck, getArchiveRemover, getCurrentTime, getElapsedPeriodsFileName, isErrorFree, isStarted, setCurrentTime, setDateInCurrentPeriod, 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 Detail
-
currentPeriodsCounter
int currentPeriodsCounter
-
maxFileSize
FileSize maxFileSize
-
nextSizeCheck
long nextSizeCheck
-
MISSING_INT_TOKEN
static java.lang.String MISSING_INT_TOKEN
-
MISSING_DATE_TOKEN
static java.lang.String MISSING_DATE_TOKEN
-
usage
private final SizeAndTimeBasedFNATP.Usage usage
-
invocationGate
InvocationGate invocationGate
-
-
Constructor Detail
-
SizeAndTimeBasedFNATP
public SizeAndTimeBasedFNATP()
-
SizeAndTimeBasedFNATP
public SizeAndTimeBasedFNATP(SizeAndTimeBasedFNATP.Usage usage)
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceLifeCycle- Overrides:
startin classTimeBasedFileNamingAndTriggeringPolicyBase<E>
-
validateDateAndIntegerTokens
private boolean validateDateAndIntegerTokens()
-
createArchiveRemover
protected ArchiveRemover createArchiveRemover()
-
computeCurrentPeriodsHighestCounterValue
void computeCurrentPeriodsHighestCounterValue(java.lang.String stemRegex)
-
isTriggeringEvent
public boolean isTriggeringEvent(java.io.File activeFile, E event)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 currently event.- Returns:
- true if a roll-over should occur.
-
getCurrentPeriodsFileNameWithoutCompressionSuffix
public java.lang.String 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
public void setMaxFileSize(FileSize aMaxFileSize)
-
-