Possible Duplicate:
How to disable logging of asset pipeline (sprockets) messages in Rails 3.1?
自从启用 Assets 管道以来,我的开发日志充满了以下内容:
Started GET "/assets/icons/close_32.png" for 127.0.0.1 at 2011-09-19 11:05:39 +0100
Started GET "/assets/vendor/colorbox/controls.png" for 127.0.0.1 at 2011-09-19 11:05:39 +0100
Served asset /icons/close_32.png - 304 Not Modified (0ms)
Served asset /vendor/colorbox/controls.png - 304 Not Modified (0ms)
这意味着获取日志中的实际请求需要大量滚动。我很少(如果有的话)关心日志中的这些 Assets 请求,那么有没有办法禁用 Assets 请求的日志记录?
最佳答案
将来的某个时候
config.assets.logger = nil
将可用,但现在尝试使用 grep 排除与 Assets 相关的所有内容。
关于logging - 不要在开发模式下记录 Rails 3.1 中的资源请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7471606/