Logging is a critical tool for maintaining any web application, and yet we're getting it wrong.
With great logs, you can see what your application is doing.
And without them?
Things can be broken left and right without you ever finding out.
Instead, you wonder why your customers don't come back, and shrug, and blame someone other than engineering.
Unfortunately, it's common for us to log in ways that are unhelpful.
Log levels are inconsistent, and logs are added to fix bugs then removed afterwards.
But come on, you saw the title, this is about the log levels, mostly.
The typical log levels
Most languages and logging libraries have a handful of log levels, at least five.
But they vary!
Here are three examples:
Rust's tracing has five log levels: ERROR, WARN, INFO, DEBUG, and TRACE.
Python's…
( 6
min )