Here is what worked for me in Rails 3.0.5:
class ActiveRecord::ConnectionAdapters::AbstractAdapter def log(sql, name) name ||= "SQL" yield rescue Exception => e message = "#{e.class.name}: #{e.message}: #{sql}" @logger.debug message if @logger raise translate_exception(e, message) end end
This is this method with a line that writes to the log. Attempts to cache SQL are still displayed in the log, and I have not figured out how to disable them.
ddurdik
source share