Files
coder/coderd/nats/natsbench
Spike Curtis a512a7f060 fix(coderd/nats): log embedded server messages with slog (#31013)
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.

<details>
<summary>Implementation decisions</summary>

- 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.

</details>

Generated by Coder Agents on behalf of @spikecurtis.
2026-10-29 11:05:54 +01:00
..