Skip to content

Instantly share code, notes, and snippets.

@eLafo
Forked from paulmars/gist:1375125
Created November 25, 2011 16:26
Show Gist options
  • Save eLafo/1393906 to your computer and use it in GitHub Desktop.
Save eLafo/1393906 to your computer and use it in GitHub Desktop.
Rails 3.1 turn off asset logging.
Source:
http://stackoverflow.com/questions/6312448/how-to-disable-logging-of-asset-pipeline-sprockets-messages-in-rails-3-1
touch config/initializers/quiet_assets.rb
mate config/initializers/quiet_assets.rb
Paste:
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment