Forem

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

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay