mirror of
https://github.com/minio/minio.git
synced 2024-12-26 23:25:54 -05:00
.. | ||
LICENSE | ||
mgorus.go | ||
README.md |
Mongodb Hooks for Logrus
Install
$ go get github.com/weekface/mgorus
Usage
package main
import (
"github.com/Sirupsen/logrus"
"github.com/weekface/mgorus"
)
func main() {
log := logrus.New()
hooker, err := mgorus.NewHooker("localhost:27017", "db", "collection")
if err == nil {
log.Hooks.Add(hooker)
}
log.WithFields(logrus.Fields{
"name": "zhangsan",
"age": 28,
}).Error("Hello world!")
}
License
MIT