What is equivalent to redis ActiveRecord::Base.logger = Logger.new(STDOUT)? I want to see what redis does.
ActiveRecord::Base.logger = Logger.new(STDOUT)
Usually I want to set some additional attributes (for example, the name DB Redis). You can pass arguments in an initialize method like this
$redis = Redis.new(db: Rails.config.redis.db, logger: Rails.logger)
$ redis.client.logger = Rails.logger
This is better!
Nothing. This is easy:
$redis = Redis.new(:host => 'localhost', :port => 6379) $redis.client.logger = Logger.new(STDOUT)
I wrote a call to the pearl of RedisLogger:
https://github.com/hellolucky/redis_logger