I might have found the cause of the problem. The Method ch.qos.logback.core.rolling.helper.TimeBasedArchiveRemover.capTotalSize(Date) seems to check only the files within the maxHistory period, therefore files outside this period are not been taken into account. This could happen if the application is not running and would roll to another file if it would running. This is the Method in question:
void capTotalSize(Date now) {
long totalSize = 0;
long totalRemoved = 0;
for (int offset = 0; offset < maxHistory; offset++) {
Date date = rc.getEndOfNextNthPeriod(now, -offset);
File[] matchingFileArray = getFilesInPeriod(date);
descendingSortByLastModified(matchingFileArray);
for (File f : matchingFileArray) {
long size = f.length();
if (totalSize + size > totalSizeCap) {
addInfo("Deleting [" + f + "]" + " of size " + new FileSize(size));
totalRemoved += size;
f.delete();
}
totalSize += size;
}
}
addInfo("Removed " + new FileSize(totalRemoved) + " of files");
}
|