Skip to content

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

Key points

  • ERROR means someone should look; WARN means something unusual that the code handled.
  • INFO records meaningful business events, not every function call.
  • DEBUG is for investigation and usually off in production.
  • Consistency across services matters more than the exact names.

The common levels

LevelUse it forExampleIn production
TRACEVery fine-grained flowEntering parseLine()Off
DEBUGDetail useful while investigatingCache miss for key user:42Off, or sampled
INFONormal, meaningful eventsOrder ord_8812 paidOn
WARNUnexpected but handledPayment API slow, retried successfullyOn
ERRORAn operation failedPayment failed after 3 retriesOn; often alerted
FATALThe process cannot continueCannot connect to database at startupOn; 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.

Syslog severities

Syslog defines eight numeric severities: 0 Emergency, 1 Alert, 2 Critical, 3 Error, 4 Warning, 5 Notice, 6 Informational, 7 Debug. Most application frameworks map their levels onto a subset of these.

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.

Frequently asked questions

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.

  • 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.