README ¶ 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 Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func NewHooker(mgoUrl, db, collection string) (*hooker, error) type M Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func NewHooker ¶ func NewHooker(mgoUrl, db, collection string) (*hooker, error) Types ¶ type M ¶ type M bson.M Source Files ¶ View all Source files mgorus.go Click to show internal directories. Click to hide internal directories.