Skip to content
Snippets Groups Projects
Commit 3bd39af9 authored by Manuel Kieweg's avatar Manuel Kieweg
Browse files

first syslog attempts

parent cda2b608
No related branches found
No related tags found
2 merge requests!41Resolve "Enhanced Logging",!18Develop
Pipeline #52255 passed with warnings
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"code.fbi.h-da.de/cocsn/gosdn/log" "code.fbi.h-da.de/cocsn/gosdn/log"
"code.fbi.h-da.de/cocsn/gosdn/nucleus" "code.fbi.h-da.de/cocsn/gosdn/nucleus"
"flag" "flag"
"log/syslog"
) )
func main() { func main() {
...@@ -17,6 +18,16 @@ func main() { ...@@ -17,6 +18,16 @@ func main() {
cliSocket := *cliListenAddr + ":" + *cliListenPort cliSocket := *cliListenAddr + ":" + *cliListenPort
log.Loglevel(log.DEBUG) log.Loglevel(log.DEBUG)
syslogWriter, err := syslog.New(syslog.LOG_INFO | syslog.LOG_ALERT, "gosdn")
defer func() {
if err := syslogWriter.Close(); err != nil {
log.Fatal(err)
}
}()
if err != nil {
log.Fatal(err)
}
log.LoglevelOutput(log.INFO, syslogWriter)
// Setup a channel to communicate if goSDN should shutdown. // Setup a channel to communicate if goSDN should shutdown.
IsRunningChannel := make(chan bool) IsRunningChannel := make(chan bool)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment