Showing SQL logging in rails console

After the third time searching how to do this, I figured it’s time to put it up here as a note to self for the next time:


logger = Logger.new(STDOUT)
ActiveRecord::Base.logger = logger
ActiveResource::Base.logger = logger