Yes, this is the beauty and pain of a ruby. I would start by overriding the Rails.logger= method in config/application.rb with some (as you say) “declare”.
Just add something like this to config/application.rb and look at the logs:
Rails.singleton_class.send('alias_method', :old_logger=, :logger=) module Rails def self.logger=(value) puts "Hey logger '#{value.inspect}' starting!" self.old_logger = value end end
Or how about just researching the value of Rails.logger ?
source share