awesome-everything RU
↑ Back to the climb

Observability

Log levels and alert routing

Crux The TRACE–FATAL ladder controls what gets stored and who gets paged. Misclassified levels pollute either the alert or the bill.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at middle altitude — in the sky
◷ 10 min

An on-call engineer’s Slack is flooded with ERROR alerts. Half are retry attempts that succeeded. The alerts are noise, real errors get buried, and the oncall tunes out. The bug is not the service — it is the level assigned to the log line.

The level ladder

The production ladder has six rungs: TRACE / DEBUG / INFO / WARN / ERROR / FATAL. Each rung is a contract about what action the log line implies.

LevelMeaningProduction defaultAlert routing
TRACEVery verbose, framework internalsOff (almost never)None
DEBUGDeveloper investigation detailOff (dynamic flag only)None
INFOState changes on the success pathOn (default)Query during investigation
WARNRecoverable issues, degraded path takenOnSlack, capacity dashboards
ERRORUnrecoverable, work left undoneOnPage on-call
FATALProcess is about to dieOnPage on-call immediately

The production default: INFO and above

The 2026 production default is INFO and above. DEBUG is enabled only via a dynamic flag during active investigation — never on by default. TRACE rarely exists outside of framework internals.

INFO represents the success path: state changes that let a human reconstruct what the service did — request_received, request_completed, kafka_message_processed, transaction_committed. Without INFO lines you cannot reconstruct normal behaviour before an error.

WARN is for recoverable issues: retry succeeded after 3 attempts, fallback path taken, deprecation hit, rate limit approached. The system continued; action may be needed eventually.

ERROR is for unrecoverable issues that left work undone: the request returned 5xx, a message went to the dead-letter queue, a write rolled back. Someone should investigate.

FATAL is for “the process is about to die”: assertion failure, out-of-memory imminent. The process typically exits or is restarted immediately after.

Alert routing follows the level ladder

The level contract implies the alert routing:

  • ERROR + FATAL feed pages and incident channels. A page is an implicit promise that action is required.
  • WARN feeds Slack and capacity dashboards. No immediate action required; trend is worth watching.
  • INFO is queried during investigation, never alerted on directly. An alert on INFO volume would fire constantly on normal traffic.
  • DEBUG / TRACE are filtered out in production storage entirely.

Why misclassified levels hurt

INFO used where WARN belongs: the issue gets buried in the INFO stream. WARN routing does not fire. The slow degradation is invisible until it becomes an ERROR.

ERROR used where WARN belongs: every retry, every cache miss, every expected timeout fires a page. The on-call tunes out. When a real ERROR arrives, it is buried in the noise. Alert fatigue is one of the most dangerous observability failures — and it is almost always caused by over-classified levels.

DEBUG left on in production: runaway cost. A service emitting DEBUG at 1000 req/s logs internal request details on every call. At pino’s ~140k msg/sec throughput this is still feasible, but the volume — 100x the INFO stream — hits the backend at full ingest cost. Teams have received 10x monthly log bills from a single PR that left a debug flag enabled.

Why this works

Dynamic DEBUG enabling is the production-safe pattern: the DEBUG level is set to OFF by default via an environment variable or a feature flag, and can be toggled at runtime (typically by updating a config map or calling a management endpoint) for a specific service instance during active investigation. After 30-60 minutes the toggle expires or is manually turned off. This pattern lets you get DEBUG detail when you need it and guarantees you never pay for it in steady state.

Quiz

A retry-attempt loop emits an ERROR on each of its 5 attempts, including the 3 that succeed. What is wrong with this classification?

Quiz

In production, which log level is the right default to emit for normal request handling (e.g., request_completed with status 200)?

Order the steps

Map each scenario to the correct log level (order from TRACE to FATAL):

  1. 1 A specific SQL query's bind parameters during debugging
  2. 2 A checkout request completed successfully (status 200)
  3. 3 A retry attempt succeeded on attempt 3 of 5
  4. 4 A request returned 503 because the upstream payment gateway timed out and work is undone
  5. 5 The application caught an unhandled exception and is about to exit
Recall before you leave
  1. 01
    What is the difference between WARN and ERROR, and why does it matter for alert routing?
  2. 02
    Why is leaving DEBUG on in production a cost risk, not just a noise risk?
  3. 03
    What is the dynamic DEBUG flag pattern, and why is it preferable to a process restart?
Recap

The six-level ladder — TRACE, DEBUG, INFO, WARN, ERROR, FATAL — serves two purposes: volume control (what gets stored) and alert routing (who gets notified). The production default is INFO and above; DEBUG is off by default and enabled only via a dynamic flag during investigation. INFO logs the success path, WARN logs recoverable degradations, ERROR logs unrecoverable failures that left work undone, and FATAL logs imminent process death. Alert routing follows directly: ERROR and FATAL page on-call, WARN feeds dashboards, INFO is queried during investigation. Misclassified levels create two failure modes: over-classification (recoverable issue as ERROR) causes alert fatigue; under-classification (unrecoverable issue as WARN) makes real failures invisible.

Connected lessons
appears again in167
Continue the climb ↑Sampling strategies and log cost
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.