You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Summary
Give
worker.logandlaunchd_stderr.logdistinct responsibilities. Today every log line goes to both, solaunchd_stderr.logis a full duplicate of the worker log and grows just as fast.Problem
createLogger()insrc/worker/logger.tswrites each formatted line withconsole.errorand also appends it toworker.log. Under launchd, stderr is redirected tolaunchd_stderr.log, which nothing rotates or trims.Confirmed on a live installation:
worker.logat 7.4 MB andlaunchd_stderr.logat 7.4 MB holding the same content - roughly 15 MB for four months, half of it redundant.Scope
worker.logholds the application log.launchd_stderr.logholds only what the logger cannot capture: uncaught exceptions, unexpected child-process output, and failures that happen before the logger is configured.npm run dev:worker), for example when no log directory is configured or when stderr is a TTY.Considerations
configureLogger()runs - aconfig.ymlthat 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.