在拖尾development.log时能否抑制资产短信?

tom*_*gal 8 logging grep ruby-on-rails tail

在开发Ruby on Rails应用程序的过程中,我不断追踪开发日志tail -f log/development.log.

我几周前才开始在Rails中开发,所以我不知道日志是否总是显示这么多条目,但我相信资产最近刚刚添加到3.1中.无论如何,这是我development.log的页面调用的一个例外:

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)
Run Code Online (Sandbox Code Playgroud)

实际上还有一些被委托,但我认为你得到的图片占用了很多空间,每个GET请求之间的所有新行.我还删除了Rails在使用时创建的所有未使用的scss和coffee文件generate.

我只是想看看在我所有的数据库调用和实际的页面调用development.log的时候我tail吧.

我想知道是否有人知道如何阻止Rails记录这些事件,或者是否有| grep办法排除与资产相关的所有内容.

非常感谢帮助,谢谢.

NAR*_*KOZ 15

在你的config/environments/development.rb集合中

config.assets.debug = false

  • 当调试模式关闭时,链接器会连接资产文件,因此您只会获取`application.js`和`application.css`的日志消息,而不会获取资产目录中的所有文件. (3认同)