Created
March 25, 2015 08:31
-
-
Save gclitheroe/919e1ef46b3e415a4603 to your computer and use it in GitHub Desktop.
Golang - Log to Logentries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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