binding.pryの中で
> ActiveRecord::Base.logger = Logger.new(STDOUT)
=> #<Logger:0x007f8664e4a740
@default_formatter=#<Logger::Formatter:0x007f8664e4a718 @datetime_format=nil>,
@formatter=nil,
@level=0,
@logdev=
#<Logger::LogDevice:0x007f8664e4a6c8
@dev=#<IO:<STDOUT>>,
@filename=nil,
@mutex=
#<Logger::LogDevice::LogDeviceMutex:0x007f8664e4a6a0
@mon_count=0,
@mon_mutex=#<Mutex:0x007f8664e4a650>,
@mon_owner=nil>,
@shift_age=nil,
@shift_size=nil>,
@progname=nil>
すると
> User.active.count
D, [2016-01-14T11:19:50.133183 #29031] DEBUG -- : CACHE (0.0ms) SELECT COUNT(*) FROM `users` WHERE `users`.`active_flag` = 1 AND `users`.`deleted_at` IS NULL AND (`users`.`global_user_id` IS NOT NULL)