Skip to content

logrus-pgx – Golang package that allows to use Logrus logger with Pgx library.

Notifications You must be signed in to change notification settings

rassakhatsky/logrus-pgx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Logrus hook for Pgx library :walrus:Build Status

Allows to use Logrus logger with Pgx package.

Installation

It is go gettable $ go get github.com/andygrunwald/go-trending

Usage

Just import it.

import "github.com/rassakhatsky/logrus-pgx"

And assign the logrus-pgx logger as default logger for Pgx.

var dbConfig pgx.ConnPoolConfig
dbConfig.Host = "some_host"
dbConfig.User = "some_user"
dbConfig.Password = "some_password"
dbConfig.Database = "some_db"
dbConfig.Logger = (*logrus_pgx.PgxLogger)(logrus.StandardLogger())
// or wrap an entry (*logrus_pgx.PgxEntry)(logrus.WithFields(logrus.Fields{"module": "pgx"}))
pgxPool, err := pgx.NewConnPool(pgx.ConnPoolConfig{})

About

logrus-pgx – Golang package that allows to use Logrus logger with Pgx library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages