4 ms·
> Nooooo to stderr, that's literally what it is there for. Bah… use syslog() (or whatever uses the same protocol) and then you get priority, name of the daemon
by bombolo 4y ago
> Nooooo to stderr, that's literally what it is there for.
Bah… use syslog() (or whatever uses the same protocol) and then you get priority, name of the daemon… and if you step it up to journald, then you get to log key:value stuff.
Of course most golang developers have never heard of syslog() and think that logging is done with stdout and then a bunch of parsers to extract information that was there to begin with, had they used a proper logging.
- deathanatos 4y agoAh, yeah. My BE work is almost exclusively inside containers, where journald is not available. (We could perhaps arrange that, but JSON-lines is typically good enough, and easier for devs to understand.) (Note that the KV stuff requires you to speak journald's protocol: syslog in systemd (and really, everything I've ever seen speak syslog) is the old BSD syslog protocol, which doesn't support KV data. Not that journald's protocol is particularly hard to speak.)
- mike22 4y agoWe can argue about exact implementation, but SRE demanding all apps (assuming non-interactive ones run on servers) log to the same channel (with enough tagging info to ID the app/server) is a good thing. In my case we are automagically configured with a Splunk appender for Logback (and the platform also sends the stdout/stderr to Splunk under a different sourceType).