1
0

silence_worker_status_logger.rb 353 B

12345678910
  1. Rails::Rack::Logger.class_eval do
  2. def call_with_silence_worker_status(env)
  3. previous_level = Rails.logger.level
  4. Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/worker_status}
  5. call_without_silence_worker_status(env)
  6. ensure
  7. Rails.logger.level = previous_level
  8. end
  9. alias_method_chain :call, :silence_worker_status
  10. end