syslog.go 407 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
import (
6
  "os"
7
  "log"
8
//  "log/syslog"
9 10 11
)

func configureSyslog() {
12 13
  //writer, err := syslog.New(syslog.LOG_INFO|syslog.LOG_DAEMON, "logstash-forwarder")
  writer, err := os.OpenFile("/var/log/logstash-forwarder.log",  os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666)
14
  if err != nil {
15
    log.Fatalf("Failed to open log: %s\n", err)
16 17 18 19
    return
  }
  log.SetOutput(writer)
}