aboutsummaryrefslogtreecommitdiffstats
path: root/logging/syslog_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'logging/syslog_unix.go')
-rw-r--r--logging/syslog_unix.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/logging/syslog_unix.go b/logging/syslog_unix.go
new file mode 100644
index 0000000..e1ddb69
--- /dev/null
+++ b/logging/syslog_unix.go
@@ -0,0 +1,20 @@
+//go:build unix
+package logging
+
+import (
+ "os"
+
+ "go.sudomsg.com/kit/net"
+)
+
+var defaultSyslogPaths = []string{"/dev/log", "/var/run/log", "/var/run/syslog"}
+
+func resolveLocalEndpoint() (net.NetType, string) {
+ for _, path := range defaultSyslogPaths {
+ if _, err := os.Stat(path); err == nil {
+ return net.NetUnixDatagram, path
+ }
+ }
+ // Fallback if no local socket is found
+ return net.NetUDP, "localhost:514"
+}