An asynchronous MongoDB Hook for Logrus
$ go get -u -v github.com/LyricTian/logrus-mongo-hook
package main
import (
"github.com/LyricTian/logrus-mongo-hook"
"github.com/sirupsen/logrus"
)
func main() {
hook := mongohook.DefaultWithURL("127.0.0.1:27017","test","t_log")
defer hook.Flush()
log := logrus.New()
log.AddHook(hook)
}
Copyright (c) 2018 Lyric