Structured JSON logging in production (2026):requestId, levels, PII

logging7 min readMay 02, 2026

Author: DevStudio.it

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.

Want help shipping this?

Related posts

Error Monitoring in Next.js, Sentry in Production, Alerts, and PII Scrubbing (2026)
6 min read
Distributed tracing & OpenTelemetry for web apps (2026)
9 min read
Error Handling and Logging in Applications, Best Practices 2026
10 min read

About the author

We build fast websites, web/mobile apps, AI chatbots and hosting setups — with a focus on SEO and conversion.

Recommended links

From theory to production — Branchly, our hosting stack and shipped work.

Like how we think? Let's build something together.

Start project configuration