Skip to content

Ops: rotate filemill.log (currently unbounded growth) #8

Description

@brocla

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:

  1. 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().
  2. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions