解决方法
要完全关闭,只需将其添加到您的环境文件(即production.rb):
config.active_record.logger = nil
见AR guide(第3.6节):
config.active_record.logger accepts a logger conforming to the@H_301_2@ interface of Log4r or the default Ruby Logger class,which is then@H_301_2@ passed on to any new database connections made. You can retrieve this@H_301_2@ logger by calling logger on either an Active Record model class or an@H_301_2@ Active Record model instance. Set to nil to disable logging.
其他帖子中记录了更多选项(如选择性打开/关闭).以Disable Rails SQL logging in console为起点.