Skip to content

fix: separate worker.log and launchd_stderr.log responsibilities #116

Description

@nonz250

Summary

Give worker.log and launchd_stderr.log distinct responsibilities. Today every log line goes to both, so launchd_stderr.log is a full duplicate of the worker log and grows just as fast.

Problem

createLogger() in src/worker/logger.ts writes each formatted line with console.error and also appends it to worker.log. Under launchd, stderr is redirected to launchd_stderr.log, which nothing rotates or trims.

Confirmed on a live installation: worker.log at 7.4 MB and launchd_stderr.log at 7.4 MB holding the same content - roughly 15 MB for four months, half of it redundant.

Scope

  • worker.log holds the application log.
  • launchd_stderr.log holds only what the logger cannot capture: uncaught exceptions, unexpected child-process output, and failures that happen before the logger is configured.
  • Keep console output for interactive runs (npm run dev:worker), for example when no log directory is configured or when stderr is a TTY.

Considerations

  • Startup failures before configureLogger() runs - a config.yml that fails to load stops every repository - currently reach stderr only. That path has to keep working, since it is the sole signal that the worker stopped entirely.
  • Touches the same file as fix: worker.log is never rotated and grows without bound #111, so the two should land in sequence rather than in parallel.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions