instance method log_at

Ruby on Rails 8.1.2

Since v6.1.7.10

Available in: v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

log_at(level, **options)

Set a different log level per request.

# Use the debug log level if a particular cookie is set.
class ApplicationController < ActionController::Base
  log_at :debug, if: -> { cookies[:debug] }
end

Parameters

level req
options keyrest
Source
# File actionpack/lib/action_controller/metal/logging.rb, line 17
      def log_at(level, **options)
        around_action ->(_, action) { logger.log_at(level, &action) }, **options
      end

Defined in actionpack/lib/action_controller/metal/logging.rb line 17 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::Logging::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close