DEV Community

Rasmus Larsson
Rasmus Larsson

Posted on • Edited on

3 1

Definition of Fatal, Error, Warn

Problem

Log and error levels are not always clearly defined making developers unsure of which level to use.

Solution

Define them explicitly. These are our definitions, you may have others.

Level Definition Examples
Fatal An error that is so bad the service/system CANNOT perform any meaningful processing, and ideally should shut itself down (Process.exit(1)). Misconfiguration of environment (wrong connection parameters etc.)
Error An error that the system/service cannot recover from, but SHOULD NOT affect other processing. Parsing errors, e.g. HTTP's "bad request".
Warn An error that the system/service MAY recover from. Retry loops, e.g. due to timeout.
Info A non-error event in the system that is of interest to the business and/or operations. Metrics, auditing, tracing etc.
Debug A log point with high detail but of low value to normal business operation. Used for understanding more about how the system is behaving.

Edit: added info and debug. Flipped the order around.

Feedback requested

If your definitions differ from ours I'm interested to hear about it. :)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs