With the new caching options in Rails 2.1 i get nice entires in my log along the lines of
Cached fragment hit: views/homepage (0.16549)
However they are logged at the :debug
level, which is the same level as the SQL output. I want to be able to disable the SQL output, and still see the cache info. How can I do this
well you could instantiate a specific logger for ActiveRecord and set it's log level to :info while leaving the default logger at debug ...
ActiveRecord::Base.logger = Logger.new("#{RAILS_ROOT}/log/#{RAILS_ENV}_database.log")
ActiveRecord::Base.logger.level = Logger::INFO # should set the log_level to info for you
from http://wiki.rubyonrails.org/rails/pages/HowtoConfigureLogging
or you could reopen AbstractAdapter and override the log(sql,name) method so it does nothing
http://api.rubyonrails.com/classes/ActiveRecord/ConnectionAdapters/AbstractAdapter.html#M001242
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With