KarelCemus / play-redis

Play framework 2 cache plugin as an adapter to redis-server
Mozilla Public License 2.0
166 stars 44 forks source link

Disable 'debug' logs #257

Closed nkmittal closed 2 years ago

nkmittal commented 2 years ago

I am using play-redis 2.6.1 in Play 2.6.x in stand-alone mode. There are two issues that I am facing:

  1. by default, this module is generating debug logs and I can't find any config option to disable it.

    2022-01-28 10:00:53,656 [debug] p.a.cache.redis - Item Test3 is not in the collection at ........."

  2. If I enable play-redis module in config file then by default it always tries to connect to Redis instance. For all developers in the team, the Redis instance is not available thus it continuously keeps printing Error messages to stdout. Is there a config option to disable redis connection ? For example:

2022-01-28 10:40:42,480 [error] r.a.RedisClientActor - CommandFailed

KarelCemus commented 2 years ago

Ad 1: just use logback to configure log level of play.api.cache.redis logger. Set it to info or higher if you will Ad 2: unfortunately I don't think so. If the module is enabled then it tries to connect to the server. Maybe you could configure the module to use some mock as default and using environment variables switch it to the real implementation in env with redis available. I believe that what you want to achieve can be done but using env variables and smart configuration.

nkmittal commented 2 years ago

Thanks for your prompt response. Will try as suggested.