diagnostics: Log over syslog

Instead of spamming the console.

Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
Ian Campbell 2016-07-01 15:20:34 +01:00
parent 421dee55d0
commit d9288f5bba

View File

@ -5,6 +5,7 @@ import (
"bytes"
"io"
"log"
"log/syslog"
"net"
"os"
"os/exec"
@ -125,6 +126,14 @@ func capture(w *tar.Writer) {
}
func main() {
syslog, err := syslog.New(syslog.LOG_INFO|syslog.LOG_DAEMON, "diagnostics")
if err != nil {
log.Fatalln("Failed to open syslog", err)
}
log.SetOutput(syslog)
log.SetFlags(0)
listeners := make([]net.Listener, 0)
ip, err := net.Listen("tcp", ":62374")