Every time I load a page, webrick pollutes its log with lots of assets rendering lines. I want it to render assets, but I don't want it to be logged, because it makes it really difficult to look into what really matters. How do I force it to stop doing that?
There is an open ticket for this https://github.com/rails/rails/issues/2639, when it is closed and you have the lastest and greatest, in config/environments/development.rb add:
config.assets.logger = nil
Until the above issues is resolve, then this will work:
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
Reference: How to disable logging of asset pipeline (sprockets) messages in Rails 3.1?
Add gem 'quiet_assets', :group => :development
to your Gemfile. See https://github.com/evrone/quiet_assets .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With