I'm glad people are paying attention to log/syslog, as that one's kind of
been a thorn for me lately. The one omission that remains even after your
patch is awareness of facility. As it stands, log/syslog writes the
priority given verbatim, like so (for a Debug message):
The problem with this is that facility is being implied as facility 0,
which is assigned to the kernel. As a result, all syslog messages emitted
by a Go program will be treated by a receiving syslogd as kernel messages.
If they end up in a "messages" file of some kind, that means the
distribution is configured to make kernel messages go to the "messages"
file as well. In my case, I have a unique syslog configuration due to
centralization, and I noticed that all Go programs were speaking as kernel
and that I was not handling them appropriately as a result.
At the very least, log/syslog should emit as facility 1, which is "user".
However, I also think that should become a default which can be changed at
run time, since I make heavy use of the local facilities (local0 through
local7) and I'm sure others do as well. Since that's an API addition,
everybody wins from the new default being "user", and those that care can
add code to pick a different facility, like "mail" or "local0".
This is a trivial patch so I might put it together if I get some time, but
I'd definitely hope you'd include it if your patch is headed for the