badguardhome/util/syslog_others.go

19 lines
325 B
Go
Raw Normal View History

// +build !windows,!nacl,!plan9
2020-02-13 11:14:30 +00:00
package util
import (
"log"
"log/syslog"
)
2020-02-13 11:14:30 +00:00
// ConfigureSyslog reroutes standard logger output to syslog
func ConfigureSyslog(serviceName string) error {
2019-02-05 11:21:07 +00:00
w, err := syslog.New(syslog.LOG_NOTICE|syslog.LOG_USER, serviceName)
if err != nil {
return err
}
log.SetOutput(w)
return nil
}