Help us understand the problem. What is going on with this article?

RailsでjsやcssなどassetsファイルへのGETでログが見辛い場合の対処法

More than 5 years have passed since last update.

railsのログでStarted GET "/assets/application.js?body=1" などjsやcssへのGETが表示されて、実際にみたいGETやPOSTが流れてしまうのを回避するには、initializerで下記の設定をすればOKらしい。
今まで知らなかった。。。

config/initializers/quiet_assets.rb
Rails.application.assets.logger = Logger.new('/dev/null') 
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'].index("/assets/") == 0 
    call_without_quiet_assets(env).tap do
      Rails.logger.level = previous_level
    end 
  end 
  alias_method_chain :call, :quiet_assets 
end 

https://github.com/rails/rails/issues/2639#issuecomment-2252326

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away