3 ms·
> Developers, in general, are really bad at logging, and so most logs are full of useless noise. Well, most logging systems do have different log priority leve
by Karellen 3y ago
> Developers, in general, are really bad at logging, and so most logs are full of useless noise.
Well, most logging systems do have different log priority levels.
https://manpages.debian.org/bookworm/manpages-dev/syslog.3.en.html#Values_for_level https://manpages.debian.org/bookworm/manpages-dev/syslog.3.e...
LOG_CRIT and LOG_ALERT are two separate levels of "this is a real problem that needs to be addressed immediately", over just the LOG_ERR "I wasn't expecting that" or LOG_WARNING "Huh, that looks sus".
Most log viewers can filter by severity, but also, the logging systems can be set to only actually output logs of a certain severity. e.g. with setlogmask(3)
https://manpages.debian.org/bookworm/manpages-dev/setlogmask.3.en.html https://manpages.debian.org/bookworm/manpages-dev/setlogmask...
If you can get devs to log with the right severities, ideally based on some kind of "what action needs to be taken in response to this log message" metric, logs can be a lot more useful. (Most log messages should probably be tagged as LOG_WARNING or LOG_NOTICE, and should probably not even be emitted by default in prod.)
> someday I want to rename that call to log.PageEntireDevTeamAt3AM()
Yup, that's what LOG_CRIT and above is for :-)
- Pawka 3y agoThat is exacly what previous commenter meant - developers a bad at setting correct serverity for logs. This becomes even a bigger proglem in huge organizations where each team has own rules so consistency vanishes.
- noctune 3y agoIn my experience, the problem usually is that severity is context sensitive. For example, a external service temporarily returning a few HTTP 500 might not be a significant problem (you should basically expect all webservices to do so occasionally), whereas it consistently returning it over a longer duration can definitely be a problem.