Logging Don';t在开发模式下记录Rails 3.1中的资产请求
可能重复:Logging Don';t在开发模式下记录Rails 3.1中的资产请求,logging,ruby-on-rails-3.1,asset-pipeline,Logging,Ruby On Rails 3.1,Asset Pipeline,可能重复: 由于启用了资产管道,我的开发日志中充满了以下内容: 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
由于启用了资产管道,我的开发日志中充满了以下内容:
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)
这意味着在日志中获取实际请求需要大量的滚动。我很少(如果有的话)关心日志中的这些资产请求,因此有没有办法禁用资产请求的日志记录?将来的某个时候
config.assets.logger = nil
将可用,但现在请尝试使用grep排除所有与资产相关的内容。正如Philip提到的
config.assets.logger = nil
它仍在Master中,因此尚未实现
但与此同时,你可以使用
config.assets.debug = false
它仍然不会一直为您服务,但不会输出那么多日志消息。
让它更干净一点