Simple SYSLOG client in Go
go get github.com/NextronSystems/simplesyslog
import (
syslog "github.com/NextronSystems/simplesyslog"
)
const SyslogServer = "<hostname>:<port>"
func main() {
client, err := syslog.NewClient(syslog.ConnectionUDP, SyslogServer)
if err != nil {
...
}
defer client.Close()
if err := client.Send("foo bar baz", syslog.LOG_LOCAL0|syslog.LOG_NOTICE); err != nil {
...
}
}