Repository navigation
feat: route all logging through a structured pino logger - #402
aliyuHabibu wants to merge 1 commit into
Conversation
Every module now logs through a component-scoped pino child (ingester:sdex, job:aggregate-refresh, ws:fanout, redis, config, webhook, route:price, startup) instead of console.*, emitted as a structured `component` field rather than a message prefix. Fastify's request logger is built from the same options so req.log is scrubbed and formatted identically. The level is configurable via LOG_LEVEL (default info, documented in .env.example): NDJSON when NODE_ENV=production, human-readable otherwise. Values of secret-looking env vars (DATABASE_URL, DIRECT_DATABASE_URL, REDIS_URL, and any name containing KEY/SECRET/TOKEN/PASSWORD) are scrubbed from every serialized line, including the password inside a connection string and driver error messages that echo it, while auth headers are redacted via pino redact. Adds a test asserting no console.* survives in non-test source and that a connection string or API key value never reaches the output.
|
@aliyuHabibu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
This is the one I want for #278 — pino rather than a hand-rolled wrapper, component children instead of message prefixes, a configurable It conflicts now — Heads-up on sequencing: #397 independently added a |
Every module now logs through a component-scoped pino child (ingester:sdex, job:aggregate-refresh, ws:fanout, redis, config, webhook, route:price, startup) instead of console.*, emitted as a structured
componentfield rather than a message prefix. Fastify's request logger is built from the same options so req.log is scrubbed and formatted identically.The level is configurable via LOG_LEVEL (default info, documented in .env.example): NDJSON when NODE_ENV=production, human-readable otherwise. Values of secret-looking env vars (DATABASE_URL, DIRECT_DATABASE_URL, REDIS_URL, and any name containing KEY/SECRET/TOKEN/PASSWORD) are scrubbed from every serialized line, including the password inside a connection string and driver error messages that echo it, while auth headers are redacted via pino redact.
Adds a test asserting no console.* survives in non-test source and that a connection string or API key value never reaches the output.
Summary
Type of change
Checklist
npx tsc --noEmitpassesnpm run buildpassesClose #332