I silenced the CACHE log using the method suggested by the post linked below.
I replaced the default ActiveRecod logger with a wrapper that filters off messages containing unwanted texts i.e. 'CACHE'.
First, create a file inside config/initializers
for example active_record.rb
and inside the file define a wrapper class and replace the active record logger like in the code below:
# Implementation of logger that ignores messages containing forbidden words
# here “CACHE” and "Settings Load"
class CacheFreeLogger < ActiveSupport::TaggedLogging
@@excluded = ['Settings Load','CACHE']
def add(severity, message = nil, progname = nil, &block)
if message.nil?
if block_given?
message = block.call
else
message = progname
progname = nil #No instance variable for this like Logger
end
end
if severity > Logger::DEBUG || !(@@excluded.map{|e| message.include? e}.include?(true))
@logger.add(severity, "#{tags_text}#{message}", progname)
end
end
end
#Replace the existing logger with the filtering one
ActiveRecord::Base.logger = CacheFreeLogger.new(ActiveRecord::Base.logger) if Rails.env.development?
The original post extended Logger not TaggedLoggin but it did not work for me.
This method was suggested in the blog: http://heliom.ca/blog/posts/disable-rails-cache-logging