rails/commands

Stop sending ActiveRecord logs to STDOUT during test/rake

Opened this issue · 2 comments

dhh commented

I can't seem to find how ActiveRecord is sending the log lines both to STDOUT and to the development.log file. But when we're running rake and test, it shouldn't send to STDOUT (because it'll spam it with INSERTS for fixtures etc).

dhh commented

@tenderlove do you know where we're now setting this STDOUT listener? When I added it, it was simply ActiveRecord::Base.logger = Logger.new(STDOUT) for the console. But it seems like that has changed.

Does it log to both? I don't see anything in *.log while in console.

Either ActiveRecord::Base.logger = Rails.logger or changing log level should work.

https://github.com/rails/rails/blob/29d564add926307fea8cd3f77caf88d735e252a1/activerecord/lib/active_record/railtie.rb#L41