123456789_123456789_123456789_123456789_123456789_

Module: ActionController::Logging::ClassMethods

Relationships & Source Files
Defined in: actionpack/lib/action_controller/metal/logging.rb

Instance Method Summary

Instance Method Details

#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
[ GitHub ]

  
# File 'actionpack/lib/action_controller/metal/logging.rb', line 15

def log_at(level, **options)
  around_action ->(_, action) { logger.log_at(level, &action) }, **options
end