Sha256: 5b52b36f9b9067af8a192e02700d0423e08278ec00b0924ed4ffc9b19685fc4a
Contents?: true
Size: 728 Bytes
Versions: 13
Compression:
Stored size: 728 Bytes
Contents
require 'action_controller/log_subscriber' ActionController::LogSubscriber module ActionController class LogSubscriber # Log as info to show Processing messages in production def start_processing(event) controller_logger(event).info { "Processing ##{event.payload[:action]}" } end private # Returns the logger for the supplied event. # Returns ActionController::Base.logger if no controller is present def controller_logger(event) if controller = event.payload[:controller] begin controller.constantize.logger rescue NameError ActionController::Base.logger end else ActionController::Base.logger end end end end
Version data entries
13 entries across 13 versions & 1 rubygems