TL;DR
- structured logging json production 2026
- For engineers running Node/Next in containers or serverless.
Who this is for
- For engineers running Node/Next in containers or serverless.
Keyword (SEO)
structured logging json production 2026
Core fields
- ts (ISO), level, service, env, message.
- requestId/traceId aligned with middleware.
- userId only if policy allows.
PII
- Never log full PANs or passwords.
- Redact email/phone in app logs.
- Separate audit channel for admin actions.
Common mistakes
- ts (ISO), level, service, env, message.
- requestId/traceId aligned with middleware.
FAQ
console.log in prod?
Avoid—use a structured logger with context and redaction.