https://github.com/meteor/logrusly
Loggly Hooks for GO Logrus logger
https://github.com/meteor/logrusly
Last synced: 5 months ago
JSON representation
Loggly Hooks for GO Logrus logger
- Host: GitHub
- URL: https://github.com/meteor/logrusly
- Owner: meteor
- License: mit
- Fork: true (sebest/logrusly)
- Created: 2015-10-06T21:02:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-06T21:12:16.000Z (over 9 years ago)
- Last Synced: 2024-09-25T13:04:56.606Z (9 months ago)
- Language: Go
- Size: 90.8 KB
- Stars: 1
- Watchers: 16
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Loggly Hooks for [Logrus](https://github.com/Sirupsen/logrus)
## Usage
```go
package mainimport (
"github.com/Sirupsen/logrus"
"github.com/sebest/logrusly"
)var logglyToken string = "YOUR_LOGGLY_TOKEN"
func 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()
}
```