News for hackers. Stuff that matters.
Re:The Five Levels of Logging by philwelch on Friday September 14, 2018 @02:12PM (#17989464)
This works at a very, very small scale where you are reading your logs by hand. At this point, you don't even need log levels.

In the real world, you're not going to read your logs unless you're trying to investigate an issue. Instead, you're going to monitor your logs. And this kind of monitoring is where WARN and ERROR become helpful.

WARNs are useful because if you run into a WARN-level issue every now and again, it's no big deal, but if you run into a ton of them, that might indicate a problem that's worth fixing. A single WARN log isn't that useful, but a statistically significant number of WARN logs is a monitorable metric. Being able to detect and address issues after they're serious enough to cause elevated WARNs but before they're serious enough to cause customer impact is worthwhile.

ERRORs are useful because then you have a one-size-fits-all way of monitoring for error conditions, if for example, it's an offline job that doesn't result in a 5xx response. You should still monitor for 5xx responses, pipeline job failures, non-zero exit codes from processes, or whatever your application-level "this didn't end well" signal is. But ERROR logging is also a good metric to have if you want to have multiple log-based metrics all in one place.

Re:The Five Levels of Logging by sagichmal on Friday September 14, 2018 @04:09PM (#17990534)
If you're parsing your logs with a machine for triage like you describe, you should be doing structured logging, not string logging.
Re:The Five Levels of Logging by philwelch on Friday September 14, 2018 @05:14PM (#17991016)
And the structure will include a log level to enable this kind of classification.
Re:The Five Levels of Logging by sagichmal on Friday September 14, 2018 @06:23PM (#17991542)
Sure, but then we're not talking logger.Info: it's a difference in kind.
Re:The Five Levels of Logging by Rapzid on Friday September 14, 2018 @05:52PM (#17991287)
We should all be doing structured logging always in 2018 IMHO. The future is now.