Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Using a remote rsyslog in Golang
package main
import (
func main() {
logwriter, e := syslog.Dial("tcp","", syslog.LOG_DEBUG, "")
if e != nil {
// normal logs
logwriter.Info("This is a test!")
// you can even send JSON like messages like this:
logwriter.Info(`@cee:{"key1":"value1", "key2":"value2"}`)
// more details about JSON CEE format in rsyslog:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.