Skip to content

LyricTian/logrus-mongo-hook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

An asynchronous MongoDB Hook for Logrus.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages