Package io.github.jbastgen.stemma.app.io
Class LogCleanup
java.lang.Object
io.github.jbastgen.stemma.app.io.LogCleanup
Removes old daily log files. Logback writes one file per day,
stemma-YYYY-MM-DD.log (and stemma-ai-YYYY-MM-DD.log
for the AI log); at the start of the
application the files whose day is more than KEEP_DAYS days ago are deleted. Only files with exactly
that name pattern are touched, so nothing else in the folder can be lost.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intLog files of the last 31 days are kept. -
Method Summary
Modifier and TypeMethodDescriptiondeleteOlderThan(Path dir, int keepDays, LocalDate today) Deletes the daily log files indirthat are older thankeepDaysdays, counted fromtoday: with 31 days, the file of the day 31 days ago stays, the one before it goes.
-
Field Details
-
KEEP_DAYS
public static final int KEEP_DAYSLog files of the last 31 days are kept.- See Also:
-
-
Method Details
-
deleteOlderThan
Deletes the daily log files indirthat are older thankeepDaysdays, counted fromtoday: with 31 days, the file of the day 31 days ago stays, the one before it goes.- Returns:
- the names of the files that were deleted
-