class

Rails::Rack::SilenceRequest

rails latest stable - Superclass: Object

Class not available on this version

This class is only available on newer versions. The first available version (v8.0.0) is shown here.

Allows you to silence requests made to a specific path. This is useful for preventing recurring requests like health checks from clogging the logging. This middleware is used to do just that against the path /up in production by default.

Example:

config.middleware.insert_before \
  Rails::Rack::Logger, Rails::Rack::SilenceRequest, path: "/up"

This middleware can also be configured using `config.silence_healthcheck_path = “/up”` in Rails.

Files

  • railties/lib/rails/rack/silence_request.rb