Class TimeBasedArchiveRemover
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover
- All Implemented Interfaces:
ArchiveRemover, ContextAware
- Direct Known Subclasses:
SizeAndTimeBasedArchiveRemover
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longprotected static final longFields inherited from class ContextAwareBase
context -
Constructor Summary
ConstructorsConstructorDescriptionTimeBasedArchiveRemover(FileNamePattern fileNamePattern, FileNamePattern fileNamePatternWithoutCompSuffix, RollingCalendar rc) TimeBasedArchiveRemover(FileNamePattern fileNamePattern, RollingCalendar rc) -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled from the cleaning thread.Future<?> voidcleanPeriod(Instant instantOfPeriodToClean) protected voiddescendingSort(File[] matchingFileArray, Instant instant) protected File[]getFilesInPeriod(Instant instantOfPeriodToClean) protected intprotected File[]getUncompressedFilesInPeriod(Instant instantOfPeriodToClean) Returns files of the given period which were not compressed, e.g. because the application was down at rollover time.voidsetMaxHistory(int maxHistory) voidsetTotalSizeCap(long totalSizeCap) toString()Methods 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, wait, wait, waitMethods inherited from interface ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
UNINITIALIZED
- See Also:
-
INACTIVITY_TOLERANCE_IN_MILLIS
- See Also:
-
-
Constructor Details
-
TimeBasedArchiveRemover
-
TimeBasedArchiveRemover
public TimeBasedArchiveRemover(FileNamePattern fileNamePattern, FileNamePattern fileNamePatternWithoutCompSuffix, RollingCalendar rc) - Parameters:
fileNamePattern- the pattern of archived filesfileNamePatternWithoutCompSuffix- the same pattern without the compression suffix, may be null. Uncompressed files matching this pattern are removed along with archived files.rc- the rolling calendar- Since:
- 1.7.0
-
-
Method Details
-
cleanAsynchronously
- Specified by:
cleanAsynchronouslyin interfaceArchiveRemover
-
clean
Called from the cleaning thread.- Specified by:
cleanin interfaceArchiveRemover- Parameters:
now-
-
getFilesInPeriod
-
getUncompressedFilesInPeriod
Returns files of the given period which were not compressed, e.g. because the application was down at rollover time. Returns an empty array if there is no compression.Only called for periods older than maxHistory. Such files are neither the active file nor being compressed.
- Since:
- 1.7.0
-
cleanPeriod
-
descendingSort
-
setMaxHistory
- Specified by:
setMaxHistoryin interfaceArchiveRemover
-
getPeriodOffsetForDeletionTarget
-
setTotalSizeCap
- Specified by:
setTotalSizeCapin interfaceArchiveRemover
-
toString
-