Errors: to Log, or Not to Log?
summary
Proposes letting errors decide whether to be logged by adding a Loggable interface that middleware queries, and introducing an ObservedError wrapper plus a metrics counter for frequent, expected failures like timeouts. Demonstrates moving error assertions into the component that produces them (HTTP client/middleware), incrementing counters instead of logging, wrapping errors to mark them observed, returning them unchanged, and shows this reduces noisy logs so critical errors stand out.
AI-written summary · about
chapters (3)
related talks
53mObservable Web Applications
30mLogging Rethought 2: The Actions of Frank Taylor Jr.
32mExpect the Unexpected: How to Deal with Errors in Large Web Applications
38mOff the Beaten Path: Moving Observability Focus from Your Service
36mBeyond grep: Practical Logging and Metrics
27mLogs Are Good, Actually
29mAre logs a software engineer's best friend? Yes - follow these best practices
34mHow to Teach a Service to Report Errors So They're Clear to Users and Machines
