我怎样才能停止在 development.log 无休止地重复 redis 和 sidekiq 日志

How can I stop endlessly repeating redis & sidekiq log at development.log

ruby rails v6.1.3.1 + sidekiq v6.2.1 + redis + redis.rb(4.2.5)

我用自制软件安装了redis。 /usr/local/etc/redis.conf没有变化。(安装后)

当我用工头开始我的 rails 进程时,如下所示的 Redis 日志不断重复。更奇怪的是这是在 development.log 文件中记录。不是 redis.log 或 sidekiq .log 文件。

我该如何阻止它?

  Redis (2114.20ms) BRPOP queue:default 2
  Redis (2114.77ms) BRPOP queue:default 2
  Redis (0.99ms) MULTI >> INCRBY stat:processed 0 >> INCRBY stat:processed:2021-04-08 0 >> EXPIRE stat:processed:2021-04-08 157680000 >> INCRBY stat:failed 0 >> INCRBY stat:failed:2021-04-08 0 >> EXPIRE stat:f                ailed:2021-04-08 157680000 >> UNLINK MacBook-Pro.local:11781:d7d3324224d3:workers >> EXPIRE MacBook-Pro.local:11781:d7d3324224d3:workers 60 >> EXEC
  Redis (0.28ms) PING
  Redis (0.57ms) MULTI >> SADD processes MacBook-Pro.local:11781:d7d3324224d3 >> EXISTS MacBook-Pro.local:11781:d7d3324224d3 >> HMSET MacBook-Pro.local:11781:d7d3324224d3 info {"hostname":"MacBook-Pro.local","                started_at":1617864827.601102,"pid":11781,"tag":"appname","concurrency":10,"queues":["default"],"labels":[],"identity":"MacBook-Pro.local:11781:d7d3324224d3"} busy 0 beat 1617864892.789145 rtt_us 442 quiet true rss 97384 >> EXPIRE MacBook-Pro.local:11781:d7d3324224d3 60 >> RPOP MacBook-Pro.local:11781:d7d3324224d3-signals >> EXEC
  Redis (0.55ms) SREM processes MacBook-Pro.local:11781:d7d3324224d3 >> UNLINK MacBook-Pro.local:11781:d7d3324224d3:workers
  Redis (1.07ms) INFO
  Redis (3.99ms) MULTI >> INCRBY stat:processed 0 >> INCRBY stat:processed:2021-04-08 0 >> EXPIRE stat:processed:2021-04-08 157680000 >> INCRBY stat:failed 0 >> INCRBY stat:failed:2021-04-08 0 >> EXPIRE stat:f                ailed:2021-04-08 157680000 >> UNLINK MacBook-Pro.local:11856:14ee4c3dc8a2:workers >> EXPIRE MacBook-Pro.local:11856:14ee4c3dc8a2:workers 60 >> EXEC
  Redis (2.34ms) PING
  Redis (0.35ms) MULTI >> SADD processes MacBook-Pro.local:11856:14ee4c3dc8a2 >> EXISTS MacBook-Pro.local:11856:14ee4c3dc8a2 >> HMSET MacBook-Pro.local:11856:14ee4c3dc8a2 info {"hostname":"MacBook-Pro.local","                started_at":1617864953.844983,"pid":11856,"tag":"appname","concurrency":10,"queues":["default"],"labels":[],"identity":"MacBook-Pro.local:11856:14ee4c3dc8a2"} busy 0 beat 1617864953.8558872 rtt_us 2498 quiet false rss 94800 >> EXPIRE MacBook-Pro.local:11856:14ee4c3dc8a2 60 >> RPOP MacBook-Pro.local:11856:14ee4c3dc8a2-signals >> EXEC
  Redis (2056.61ms) BRPOP queue:default 2
  Redis (2056.98ms) BRPOP queue:default 2
  Redis (2056.59ms) BRPOP queue:default 2

原因是 gem 'cacheflow' 我为 memcached 调试添加了缓存流,但我没有发现它会影响 redis/sidekiq

https://github.com/ankane/cacheflow#features有解决办法。

Cacheflow.silence_sidekiq!