Putting more than 2 log levels (and, most of the time, putting more than 1 log level) into the logs your service outputs is a waste of time and just promises to make things confusing for the operator trying to make sense of what’s happening. Just give people all the output and let them filter it however they want.
The only exception I’d make is maybe “trace” level where you spit out everything that happens, good or bad, which is just there for you (the programmer) to make sense of bugs.
So, error logs, warnings, informational, and debug logs should all just go to stdout at all times, no --verbose or -vvv should exist, everyone who wants to filter logs will have to pipe it through grep or some other program to help filter the logs? Or am I understanding that incorrectly?
Log levels are superstition.
What does that mean?
Putting more than 2 log levels (and, most of the time, putting more than 1 log level) into the logs your service outputs is a waste of time and just promises to make things confusing for the operator trying to make sense of what’s happening. Just give people all the output and let them filter it however they want.
The only exception I’d make is maybe “trace” level where you spit out everything that happens, good or bad, which is just there for you (the programmer) to make sense of bugs.
So, error logs, warnings, informational, and debug logs should all just go to
stdout
at all times, no--verbose
or-vvv
should exist, everyone who wants to filter logs will have to pipe it throughgrep
or some other program to help filter the logs? Or am I understanding that incorrectly?Yep, that’s the take. Or you aggregate logs and search them through a search interface. Or you output structured logs, and use structured search.
The take