Name: logrusly
Owner: Meteor
Description: Loggly Hooks for GO Logrus logger
Forked from: sebest/logrusly
Created: 2015-10-06 21:02:30.0
Updated: 2015-10-06 21:02:31.0
Pushed: 2015-10-06 21:12:16.0
Homepage: null
Size: 93
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
age main
rt (
"github.com/Sirupsen/logrus"
"github.com/sebest/logrusly"
logglyToken string = "YOUR_LOGGLY_TOKEN"
main() {
log := logrus.New()
hook := logrusly.NewLogglyHook(logglyToken, "www.hostname.com", logrus.WarnLevel, "tag1", "tag2")
log.Hooks.Add(hook)
log.WithFields(logrus.Fields{
"name": "joe",
"age": 42,
}).Error("Hello world!")
// Flush is automatic for panic/fatal
// Just make sure to Flush() before exiting or you may loose up to 5 seconds
// worth of messages.
hook.Flush()