新建 config/initializers/quiet_assets.rb
if Rails.env.development? Rails.application.assets.logger = Logger.new(File.join(Rails.root,'log/assets.log')) Rails::Rack::Logger.class_eval do def call_with_quiet_assets(env) prevIoUs_level = Rails.logger.level Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/assets/} call_without_quiet_assets(env) ensure Rails.logger.level = prevIoUs_level end alias_method_chain :call,:quiet_assets endend
原文链接:https://www.f2er.com/javaschema/285808.html