5

When I run rails s it loads up and everything works. When I browse to a page several lines of information are printed. Mostly this is the webpage getting the assets for the page. I really don't need to see this and have it clutter my screen. Is there a way to customize what gets printed in console?

Thanks

recursive_acronym
  • 2,981
  • 6
  • 40
  • 59

3 Answers3

3

For assets pipeline messages it seems that you can't (yet). See How to disable logging of asset pipeline (sprockets) messages in Rails 3.1? and the rails issue on Github

You can do it in part by using these lines (credits) in your development.rb file

config.after_initialize do |app|
  app.assets.logger = Logger.new('/dev/null')
end
Community
  • 1
  • 1
Fabio
  • 18,856
  • 9
  • 82
  • 114
  • I just tried it on rails 3.1 and with log-level :warn you don't get the asset pipeline logs – spike Sep 27 '11 at 00:31
  • 1
    @spike yes, but with `:warn` loglevel you're suppressing also AR queries (which has :debug priority), this would be undesirable during development. – Fabio Sep 27 '11 at 00:39
3

For Rails 3.1, inside config/environments/development.rb, set the following to false:

config.assets.debug = false

Your logs will show you everything you want to see minus the assets.

Jeff Devine
  • 596
  • 2
  • 8
1

You can configure the logging detail of the rails dev server by setting config.log_level in environments/development.rb. Setting it to :warn will get rid of most of the logging (you can always send your own messages with whatever log level you want so they still get printed).

http://guides.rubyonrails.org/debugging_rails_applications.html#log-levels

http://guides.rubyonrails.org/debugging_rails_applications.html#log-levels

spike
  • 9,794
  • 9
  • 54
  • 85