/logrus-mongo-hook

An asynchronous MongoDB Hook for Logrus.

Primary LanguageGoMIT LicenseMIT

An asynchronous MongoDB Hook for Logrus

Build Codecov ReportCard GoDoc License

Quick Start

Download and install

$ go get -u -v github.com/LyricTian/logrus-mongo-hook

Usage

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)
}

MIT License

Copyright (c) 2018 Lyric