Docs
/
Node Express
Chapter 13
13 — Error Handling & Logging
Core Concepts
- Centralized error handler — single middleware to handle all errors
- Custom error classes — typed errors with status codes
- Operational vs Programmer errors — expected vs bugs
- Winston / Pino — production-grade logging libraries
- Request logging — log every request with duration, status, etc.
- Structured logging — JSON logs for log aggregation tools