Monitoring glossary
Log levels explained
Log levels sort messages by importance so you can keep production quiet, find problems quickly and alert only on what matters.
3 min read10 sectionsUpdated
On this page
| Level | Use it for | Example | In production |
|---|---|---|---|
| TRACE | Very fine-grained flow | Entering parseLine() | Off |
| DEBUG | Detail useful while investigating | Cache miss for key user:42 | Off, or sampled |
| INFO | Normal, meaningful events | Order ord_8812 paid | On |
| WARN | Unexpected but handled | Payment API slow, retried successfully | On |
| ERROR | An operation failed | Payment failed after 3 retries | On; often alerted |
| FATAL | The process cannot continue | Cannot connect to database at startup | On; alert |
Rules of thumb
- If nobody will act on it, it is not an ERROR. Validation failures from user input are INFO or WARN.
- Log an error once, where it is handled, not at every layer it passes through.
- Include context as fields: IDs, durations, the trace ID, not concatenated strings.
- Never log secrets or full payloads with personal data.
- Make the level configurable at runtime so you can turn on DEBUG for one service during an incident.
Levels and alerting
Alert on rates, not single lines: "more than 20 ERROR logs per minute from checkout" is useful; "any ERROR" pages people for harmless noise. Better still, alert on user-facing symptoms such as error rate in APM and use logs to explain them. See alerting best practices.
Examples by level
- DEBUG:
cache miss key=product:812 ttl=300 - INFO:
order paid order_id=ord_8812 amount=49.00 currency=EUR - WARN:
payment provider slow duration_ms=4210 attempt=2 outcome=success - ERROR:
payment failed order_id=ord_8812 attempts=3 reason=timeout - FATAL:
cannot connect to database host=db-1 after 10 attempts; exiting
Each line carries the fields someone would search for. None of them includes a card number, password or token.
Changing the level at runtime
Most logging libraries read the level from an environment variable or config, such as LOG_LEVEL=info. Prefer a mechanism that can change the level without a redeploy, for one service or one instance, and that reverts automatically after a set time. That makes it safe to turn on DEBUG during an investigation without flooding storage for days.
Should I log at INFO in production?
Yes, for meaningful events. If INFO volume is too high, you are probably logging too many routine steps; move them to DEBUG.
What is the difference between WARN and ERROR?
WARN: something unexpected happened but the operation still succeeded. ERROR: the operation failed.
Related reading
- Best log management tools: How to choose a log management tool in 2026: search, retention, cost control and trace links, well-known options compared, and which fits which team.
- What is log optimization?: Log optimization explained: finding the noisiest log sources, levels and sampling, structured fields, dropping duplicates, retention tiers.
- WordPress white screen of death: how to fix it: Fix the WordPress white screen of death: enable debug logging safely, disable plugins and themes with WP-CLI or FTP, and raise memory only when needed.
- HTTP status codes explained, with fixes for the common errors: HTTP status codes explained by class, with what each common code means and links to step-by-step fixes for 403, 429, 500, 502, 503, 504 and Cloudflare 52x.
- Log management: Centralized log management: send structured logs over HTTPS, search and filter them, watch them live, parse with pipelines and open the trace behind a line.
- Service level indicators (SLIs): Save an SLI once from uptime checks, API latency or errors. See it over the last hour, day, week and month, and build SLOs and SLAs on it.
Watch your own site and services with VitalRix
Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.