On a Debian 9 (stretch) system, 4.14 kernel I have some applications written in Go that make extensive use of logging. I'm finding that these log messages are being triplicated.
With the following code, all log messages are written to /var/log/messages , /var/log/kern.log and /var/log/syslog
I think it has something to do with journald and syslog (or rsyslog) doing double duty but I'm not sure.
If it helps, this is a stock Beaglebone Black running the Debian distro.
How do I stop these messages from being written to kern.log and syslog and just write them to messages?
package main
import (
"log"
"log/syslog"
)
func main() {
logwriter,e:= syslog.New(syslog.LOG_NOTICE,"testprog")
if e == nil {
log.SetOutput(logwriter)
}
log.Println("Hello Friend")
}