syslog.go 290 Bytes
Newer Older
Jordan Sissel's avatar
Jordan Sissel committed
1
// +build !windows
Jordan Sissel's avatar
.  
Jordan Sissel committed
2

3
package main
4 5 6 7 8 9
import (
  "log"
  "log/syslog"
)

func configureSyslog() {
10
  writer, err := syslog.New(syslog.LOG_INFO | syslog.LOG_DAEMON, "logstash-forwarder")
11 12 13 14 15 16
  if err != nil {
    log.Fatalf("Failed to open syslog: %s\n", err)
    return
  }
  log.SetOutput(writer)
}