Source file
src/log/syslog/syslog_unix.go
1
2
3
4
5
6
7 package syslog
8
9 import (
10 "errors"
11 "net"
12 )
13
14
15
16
17 func unixSyslog() (conn serverConn, err error) {
18 logTypes := []string{"unixgram", "unix"}
19 logPaths := []string{"/dev/log", "/var/run/syslog", "/var/run/log"}
20 for _, network := range logTypes {
21 for _, path := range logPaths {
22 conn, err := net.Dial(network, path)
23 if err == nil {
24 return &netConn{conn: conn, local: true}, nil
25 }
26 }
27 }
28 return nil, errors.New("Unix syslog delivery error")
29 }
30
View as plain text