Skip to content

fix(coderd/nats): log embedded server messages with slog - #31013

Draft
spikecurtis wants to merge 1 commit into
mainfrom
spikecurtis/nats-server-logging
Draft

spikecurtis wants to merge 1 commit into
mainfrom
spikecurtis/nats-server-logging

Conversation

@spikecurtis

Copy link
Copy Markdown
Contributor

Route embedded NATS server logs through Coder's slog logger by installing a natsserver.Logger adapter with SetLoggerV2 before starting the server. Add coverage for severity mapping, formatting, startup logging, and debug filtering, and allow expected NATS errors in the existing failure-path and teardown tests.

Refs GRU-98.

Implementation decisions
  • Preserve the caller's logger fields and add the server logger name.
  • Let slog filter debug output; leave protocol and system-account tracing disabled to avoid logging message payloads.
  • Map NATS fatal messages to slog Critical so adding logging does not introduce process termination.
  • Restrict test log allowances to the embedded server's expected errors rather than ignoring all error logs.

Generated by Coder Agents on behalf of @spikecurtis.

@linear-code

linear-code Bot commented Oct 19, 2026

Copy link
Copy Markdown

GRU-98

This branch has not been deployed

No deployments
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