You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Anand Babu (AB) Periasamy 1394d8a7a8 logrus based logger 9 years ago
..
LICENSE logrus based logger 9 years ago
README.md logrus based logger 9 years ago
mgorus.go logrus based logger 9 years ago

README.md

Mongodb Hooks for Logrus :walrus:

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