Skip to content
AlexLastPublic

About

A query hook for uptrace/bun that logs with go-micro/logger.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

bunmicro

A query hook for uptrace/bun that logs with go-micro/logger.

$ go get github.com/alexlast/bunmicro

All errors will be logged at error level with the hook enabled, everything else will be logged as debug. If SlowDuration is defined, only operations taking longer than the defined duration will be logged.

Usage

db := bun.NewDB()
db.AddQueryHook(bunmicro.NewQueryHook(bunmicro.QueryHookOptions{
    Logger:       logger.DefaultLogger,
    SlowDuration: 200 * time.Millisecond, // Omit to log all operations as debug
}))

About

A query hook for uptrace/bun that logs with go-micro/logger.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

⌂ 换网址