Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails logger messages test.log?

Is it possible to configure rails to show logger.debug messages (from logger.debug statements inside controllers) to display inside test.log (or to the console) when running unit and functional tests?

I added the following to test_helper.rb. I see messages from logger.debug statements directly inside tests but no messages from logger statements inside controller methods?

def logger
    RAILS_DEFAULT_LOGGER
end
like image 253
Upgradingdave Avatar asked Mar 24 '10 18:03

Upgradingdave


2 Answers

Works fine for me. Have you set your config.log_level to something specific?

Eitherway,

config.log_level = :debug 

should work?

like image 110
Apie Avatar answered Sep 21 '22 10:09

Apie


From Rails 3.2 upwards the method in test_helper.rb should look like this:

def logger
    Rails.logger
end
like image 34
Kari Avatar answered Sep 22 '22 10:09

Kari