Skip to content

Feature Request: ability to provide a logger as an Options setting #3558

@ccoVeille

Description

@ccoVeille

Right now, the logger is global to the module.

This could help to solve things like this:

  • we may want a VoidLogger for one client, or for the sentinel client but not the others
  • provide better context error with each client, for example when code handles connections to multiple Redis instances
  • it can be challenging when dealing with unit tests.

Here this issue is here to get feedback about the idea.

I feel like a client option for the logger of the NewClient, NewSentinel and NewDialer seems an easy way to provide this
https://pkg.go.dev/github.com/redis/go-redis/v9#Options

Then we would fall back on the global logger.

I can implement this if you are fine with the idea.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions