Repository navigation
feat(backend): keep up to a week in the current log file and cap log history - #682
Merged
Merged
Conversation
…history Roll the log file weekly instead of daily (still at 10 MB at most), so /actuator/logfile shows up to a week of logs. Keep 13 weeks (about 90 days) of archived logs, capped at 1 GB; before, archives were never deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWRrkPxjD9vpVSdEeCvnXX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by ju · project thread
Summary
/actuator/logfileonly serves the current log file. That file used to roll over daily, so the weekly import health check could only see the logs since midnight. Archived logs were also never deleted.YYYY-ww(week-based year). I checked this with logback 1.5.38:yyyy-wwwould name the files for 2026-12-27 to 12-312026-01and collide with January 2026.maxHistory13 (logback counts this in rollover periods, here weeks, so about 90 days), capped at 1 GB withtotalSizeCap.Weeks start on the JVM locale's first day of the week (Sunday for
en_US). At the start of a week the current file only holds a day or two.Testing
RollingCalendardetectsYYYY-wwasTOP_OF_WEEK. Across the 2026/2027 year boundary, files are named 2026-52, then 2027-01, then 2027-02.totalSizeCap1 GB.Deployment notes
No action required. The old daily archives (
logs/archived/spring-boot-logger-YYYY-MM-DD.N.log) don't match the new pattern, so logback won't delete them and they don't count towards the 1 GB cap. Delete them by hand if you want the space back.Generated by Claude Code