diff --git a/activesupport/lib/active_support/deprecation/behaviors.rb b/activesupport/lib/active_support/deprecation/behaviors.rb index 0c065fb103..ca23d45666 100644 --- a/activesupport/lib/active_support/deprecation/behaviors.rb +++ b/activesupport/lib/active_support/deprecation/behaviors.rb @@ -23,7 +23,13 @@ module ActiveSupport $stderr.puts callstack.join("\n ") if debug }, 'development' => Proc.new { |message, callstack| - logger = (Rails.logger if defined?(Rails)) || Logger.new($stderr) + logger = + if defined?(Rails) && Rails.logger + Rails.logger + else + require 'logger' + Logger.new($stderr) + end logger.warn message logger.debug callstack.join("\n ") if debug }