Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Structured logging

StableRoute backend uses request-scoped correlation via `X-Request-Id` (see
`docs/middleware-order.md`). Each handler calls `sendError` / `recordEvent` with
the active request id so operators can trace a single client call through audit
events and Prometheus gauges.

Recommended log fields when extending handlers:

- `requestId` — propagated from middleware
- `route` — Express path template
- `status` — HTTP status emitted
- `eventType` — audit log category when applicable

Pair and webhook mutations emit structured audit events (`pair.registered`,
`webhook.created`, etc.) rather than ad-hoc `console.log` output.