0

ローカル サーバーで行うすべてのリクエストで、次のような大量のログ メッセージが生成されます。

[aa6f821b342dc08800f423e86d24db20] [127.0.0.1]   Rendered shared/_footer.html.erb (3.5ms)
[aa6f821b342dc08800f423e86d24db20] [127.0.0.1] Completed 200 OK in 2684ms (Views: 590.0ms | ActiveRecord: 191.8ms)
[cd2037fee6bd082a4119d8799a7e7439] [127.0.0.1] 
[cd2037fee6bd082a4119d8799a7e7439] [127.0.0.1] 
[cd2037fee6bd082a4119d8799a7e7439] [127.0.0.1] Started GET "/assets/global.css?body=1" for 127.0.0.1 at 2013-01-18 19:39:22 -0500
[cd2037fee6bd082a4119d8799a7e7439] [127.0.0.1] Served asset /global.css - 304 Not Modified (3ms)
[5f2da9e4e857fb4e8c024a95a424fc14] [127.0.0.1] 
[5f2da9e4e857fb4e8c024a95a424fc14] [127.0.0.1] 
[5f2da9e4e857fb4e8c024a95a424fc14] [127.0.0.1] Started GET "/assets/caEntry.css?body=1" for 127.0.0.1 at 2013-01-18 19:39:22 -0500
[5f2da9e4e857fb4e8c024a95a424fc14] [127.0.0.1] Served asset /caEntry.css - 304 Not Modified (2ms)
[708c81464666f10e1b2a46e1dbf4af71] [127.0.0.1] 
[708c81464666f10e1b2a46e1dbf4af71] [127.0.0.1] 
[708c81464666f10e1b2a46e1dbf4af71] [127.0.0.1] Started GET "/assets/forms.css?body=1" for 127.0.0.1 at 2013-01-18 19:39:22 -0500
[708c81464666f10e1b2a46e1dbf4af71] [127.0.0.1] Served asset /forms.css - 304 Not Modified (2ms)
[3a807660584a753319c6c19c405b9cce] [127.0.0.1] 
[3a807660584a753319c6c19c405b9cce] [127.0.0.1] 

何がロードされているかを知りたいのですが、これらの空のメッセージを少しきれいにする方法はありませんか?

4

1 に答える 1

0

宝石がありますが、名前を思い出せません...これを入れてくださいconfig/initializers/quiet_assets.rb

Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
  def before_dispatch_with_quiet_assets(env)
    before_dispatch_without_quiet_assets(env) unless env['PATH_INFO'].index("/assets/") == 0
  end
  alias_method_chain :before_dispatch, :quiet_assets
end
于 2013-01-19T01:16:20.667 に答える