mirror of
https://github.com/netbirdio/netbird.git
synced 2024-11-23 16:43:29 +01:00
21 lines
349 B
Go
21 lines
349 B
Go
|
//go:build !windows
|
||
|
// +build !windows
|
||
|
|
||
|
package util
|
||
|
|
||
|
import (
|
||
|
"log/syslog"
|
||
|
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
lSyslog "github.com/sirupsen/logrus/hooks/syslog"
|
||
|
)
|
||
|
|
||
|
func AddSyslogHook() {
|
||
|
hook, err := lSyslog.NewSyslogHook("", "", syslog.LOG_INFO, "")
|
||
|
|
||
|
if err != nil {
|
||
|
log.Errorf("Failed creating syslog hook: %s", err)
|
||
|
}
|
||
|
log.AddHook(hook)
|
||
|
}
|