Skip to content

fix(logger): silence pino-loki errors when Loki is unreachable#412

Open
dimakis wants to merge 1 commit into
mainfrom
fix/loki-silence-errors
Open

fix(logger): silence pino-loki errors when Loki is unreachable#412
dimakis wants to merge 1 commit into
mainfrom
fix/loki-silence-errors

Conversation

@dimakis

@dimakis dimakis commented Jun 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds silenceErrors: true to the pino-loki transport config
  • Prevents stderr spam (50+ full stack traces) when Loki container is down or still starting up
  • Loki is optional observability infra — file and stdout logging are unaffected

Context

pino-loki dumps AggregateError [ECONNREFUSED] with a full stack trace to stderr on every log line when it can't reach port 3200. This happens during Loki container startup or when the observability stack isn't running. The noise makes it harder to debug actual issues.

Test plan

  • Verify server starts cleanly without Loki running (no stderr spam)
  • Verify logs still flow to Loki when it's available
  • Existing logger tests pass

🤖 Generated with Claude Code

Prevents stderr spam with full stack traces on every log line when
Loki container is down or still starting up.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@dimakis dimakis left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Centaur Review

LGTM — no issues found.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant