https://github.com/icoom-lab/logrus2logtail
Logtail hooks for Logrus
https://github.com/icoom-lab/logrus2logtail
logrus logrus-hook logtail
Last synced: 5 months ago
JSON representation
Logtail hooks for Logrus
- Host: GitHub
- URL: https://github.com/icoom-lab/logrus2logtail
- Owner: icoom-lab
- License: mit
- Created: 2022-10-16T00:04:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-18T12:45:15.000Z (over 3 years ago)
- Last Synced: 2024-06-20T16:50:11.358Z (about 2 years ago)
- Topics: logrus, logrus-hook, logtail
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logrus2logtail
Logtail hooks for Logrus
## Installation
```
go get github.com/icoom-lab/logrus2logtail
```
## Usage
```go
package main
import (
log "github.com/sirupsen/logrus"
"github.com/icoom-lab/logrus2logtail"
)
func main() {
hook, err := logrus2logtail.NewHook("enter_token_here")
if err != nil {
log.Error("Error:", err)
}
log.AddHook(hook)
log.WithFields(log.Fields{
"animal": "walrus",
"size": 10,
}).Info("A group of walrus emerges from the ocean")
log.Debug("This is a debug message")
}
```
## License
**logrus2logtail** is released under [the MIT license](LICENSE).