Giter Club home page Giter Club logo

mgorus's People

Contributors

brunetto avatar normegil avatar requilence avatar snowmen10 avatar weekface avatar zalgo2462 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mgorus's Issues

how to use this hook with logrus levels?

     logHook, err := mgorus.NewHooker(cnf.LogHook.DBHost, cnf.LogHook.DBName, cnf.LogHook.System)
	if err != nil {
		return nil, err
	}

        svc.Logger = log.New()
	svc.Hooks.Add(logHook)
	log.SetLevel(logrus.ErrorLevel)

in fact shows all levels logs

Dynamic collection

Is there any way I can choose the collection dynamically when writing the log?
I need to log to different collections based on if it's a message, execution result etc ...

Fail to connect with provided constructors

Hi,
thank you for providing this logrus hook.
I can't connect to my mongo cluster using the provided constructors.
After few attempts I was able to connect to the mongo cluster with this code (coming from few different post found on internet, none of which was enough to work):

dialInfo := &mgo.DialInfo{
	Addrs: []string{
		"cluster-prefix-1.mongodb.net:27017",
		"cluster-prefix-2.mongodb.net:27017",
		"cluster-prefix-3.mongodb.net:27017",
	},
	Timeout:  20 * time.Second,
	Database: "admin",
	Username: "USER",
	Password: "PW",
	DialServer: func(addr *mgo.ServerAddr) (net.Conn, error) {
		conn, err := tls.Dial("tcp", addr.String(), &tls.Config{InsecureSkipVerify: true})
		return conn, err
	},
}

s, err := mgo.DialWithInfo(dialInfo)
if err != nil {
	log.Fatalf(can't connect: %v\n", err)
}

I propose the following new constructor with this PR to let the users be free to connect in whichever way they can:

func NewHookerFromCollection(collection *mgo.Collection)*hooker{
	return &hooker{c: collection}
}

Mongodb authentication

How do I authenticate with my DB? Using MongoDb authentication in the url failed to work.
Thanks.

New Trace log level in logrus

Hello, I'm just opening this issue to let you know, the next release of logrus (v1.2.0) will add a new trace level named Trace below Debug.
Here is the PR for reference sirupsen/logrus#844
You may want to take into account this new level.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.