Structured Logging

Operate Sushi SaaS with structured, correlated, redacted logs across Node and edge runtimes.

Synced with starter commit 7d452a6.

The Node runtime uses Pino and edge code emits the same JSON-shaped contract. Logs go to stdout for the hosting platform to collect; the application does not manage log files. Set LOG_LEVEL to debug, info, warn, or error.

Pass the request ID through routes, services, jobs, Stripe orders/events, and provider calls. Log structured fields such as event name, org_uuid, safe resource UUID, job/order number, duration, and result—not a prose-only message.

The logger redacts authorization headers, cookies, passwords, tokens, API keys, and other catalogued secrets. Never log raw request bodies, presigned URLs, or exported account data. Route boundaries pass failures to respError, which records internal context while returning a translated safe error_code; never expose error.message to the browser.

Monitor readiness, cron runs, retry exhaustion, webhook action-required state, latency, and unexpected 5xx rates. Correlate Slack alerts back to logs by identifiers; Slack is not the log store.

Structured Logging · Sushi SaaS