Fixed review comments

Fixed running as a windows service
Added logging to windows evenlog
This commit is contained in:
Andrey Meshkov
2019-02-05 14:09:05 +03:00
parent a4dc4c61d8
commit 448a6caeb8
8 changed files with 252 additions and 52 deletions

18
syslog_others.go Normal file
View File

@@ -0,0 +1,18 @@
// +build !windows,!nacl,!plan9
package main
import (
"log"
"log/syslog"
)
// configureSyslog reroutes standard logger output to syslog
func configureSyslog() error {
w, err := syslog.New(syslog.LOG_NOTICE|syslog.LOG_USER, "AdGuard Home")
if err != nil {
return err
}
log.SetOutput(w)
return nil
}