Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sebest/logrusly
Loggly Hooks for GO Logrus logger
https://github.com/sebest/logrusly
Last synced: about 2 months ago
JSON representation
Loggly Hooks for GO Logrus logger
- Host: GitHub
- URL: https://github.com/sebest/logrusly
- Owner: sebest
- License: mit
- Created: 2014-09-11T23:27:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2021-07-27T21:32:29.000Z (over 3 years ago)
- Last Synced: 2024-07-31T20:52:13.614Z (5 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 28
- Watchers: 5
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - logrusly - [logrus](https://github.com/sirupsen/logrus) plug-in to send errors to a [Loggly](https://www.loggly.com/). (Logging / Search and Analytic Databases)
- awesome-go - logrusly - Loggly Hooks for GO Logrus logger - ★ 24 (Logging)
- awesome-go-extra - logrusly - 09-11T23:27:11Z|2021-07-27T21:32:29Z| (Logging / Advanced Console UIs)
- awesome-go-zh - logrusly
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()
}
```