8

During development of Ruby on Rails applications I have the development log constantly tailing via tail -f log/development.log.

I have only started developing in Rails a few weeks ago, so I don't know if the log has always shown this many entries, but I believe assets have just recently been added in 3.1. Regardless, this is an exerpt of my development.log for a page call:

Started GET "/assets/reset.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /reset.css - 304 Not Modified (1ms)


Started GET "/assets/style.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /style.css - 304 Not Modified (0ms)


Started GET "/assets/application.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Started asset /application.css - 304 Not Modified (0ms)


Started GET "/assets/application.js?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /application.js - 200 OK (1ms)

There are actually a few more entried, but I think you got the picture of this taking up a lot of space with all the new lines in between each GET request. I also delete all the unused scss and coffee files that Rails creates when using generate.

I just want to see all database calls and actual page calls in my development.log when I tail it.

I was wondering if anyone knows of a way to stop Rails logging these events, or if there is a | grep way of excluding everything related to assets.

Help is much appretiated, thanks.

tomthorgal
  • 525
  • 1
  • 4
  • 14

1 Answers1

15

In your config/environments/development.rb set

config.assets.debug = false

NARKOZ
  • 27,203
  • 7
  • 68
  • 90
  • it is obviously it has to help but i still get Started GET "/assets/application.js" for 127.0.0.1 at Mon Apr 09 00:16:01 +0300 2012 Served asset /application.js - 304 Not Modified (200ms) what can be wrong? (i have restarted server twice) – okliv Apr 08 '12 at 21:18
  • 3
    When debug mode is off, sprockets concatenates asset files, so you will get log messages only for `application.js` and `application.css`, and not for all files in assets directory. – NARKOZ Apr 09 '12 at 15:54