intermediate
Logging
Application and platform logs that explain what happened, with structured fields, useful levels, correlation, and safe handling of sensitive data.
Logging interviews focus on explainability: what happened, for which request, with what outcome—without leaking secrets. Structured JSON, sensible levels, correlation IDs, and PII redaction are table stakes for FullStack JS teams shipping Node APIs and browser clients.
Subtopics: structured logs, log levels, correlation IDs, PII-safe logging.
On interviews: design a logger middleware for Express/Fastify; choose levels for retry vs fatal payment failure; redact email while keeping userId for support.
Common pitfalls: string-only logs; logging bodies; missing request ID in workers; debug left on in production.
The trade-off is forensic detail versus storage cost, query performance, and compliance risk.
Checklist:
- Structured fields with stable schema.
- Propagate correlation IDs end to end.
- Redact before export to vendors.
- Tune levels per environment.