Skip to content

Instantly share code, notes, and snippets.

@gclitheroe
Created March 25, 2015 08:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gclitheroe/919e1ef46b3e415a4603 to your computer and use it in GitHub Desktop.
Save gclitheroe/919e1ef46b3e415a4603 to your computer and use it in GitHub Desktop.
Golang - Log to Logentries
ackage main
import (
"log"
"log/syslog"
)
func main() {
w, err := syslog.Dial("tcp", "api.logentries.com:10000", syslog.LOG_NOTICE, "LE_TOKEN")
if err != nil {
log.Fatal(err)
}
log.SetOutput(w)
log.Println("Hello Logentries.")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment