Backlog: Observability & ops
Problem
data/logs/filemill.log is opened append-only and grows unbounded (internal/app/app.go, App.Open). On an always-on service it will grow forever — slow disk creep and an unwieldy file for debugging.
Proposed solution
Add log rotation, cheapest first:
- Size-based rotation in-process — a small rotating writer (e.g.
gopkg.in/natefinch/lumberjack.v2) wrapping the log sink: cap file size, keep N backups, optional compression. Minimal code; the mailgun logger already shares this sink via App.LogWriter().
- External rotation — a scheduled task / logrotate-style script. No code, but another moving part.
Notes
- Keep it simple; single-user scale doesn't need much. Size cap + a couple of backups is plenty.
- Make sure both the app logger and the mailgun
MultiWriter sink go through the rotated writer so nothing bypasses rotation.
Backlog: Observability & ops
Problem
data/logs/filemill.logis opened append-only and grows unbounded (internal/app/app.go,App.Open). On an always-on service it will grow forever — slow disk creep and an unwieldy file for debugging.Proposed solution
Add log rotation, cheapest first:
gopkg.in/natefinch/lumberjack.v2) wrapping the log sink: cap file size, keep N backups, optional compression. Minimal code; the mailgun logger already shares this sink viaApp.LogWriter().Notes
MultiWritersink go through the rotated writer so nothing bypasses rotation.