DEV Community

Rasmus Larsson
Rasmus Larsson

Posted on • Updated on

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. :)

Top comments (0)