lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-3.1.1 vs lib/new_relic/control/frameworks/rails.rb in newrelic_rpm-3.1.2.beta1
- old
+ new
@@ -84,16 +84,21 @@
log!("Developer mode not available for Rails versions prior to 2.2", :warn)
end
end
def log!(msg, level=:info)
- super unless should_log?
- logger.send(level, msg)
+ if should_log?
+ logger = ::Rails.respond_to?(:logger) ? Rails.logger : ::RAILS_DEFAULT_LOGGER
+ logger.send(level, msg)
+ else
+ super
+ end
rescue Exception => e
super
end
def to_stdout(message)
+ logger = ::Rails.respond_to?(:logger) ? Rails.logger : ::RAILS_DEFAULT_LOGGER
logger.info(message)
rescue Exception => e
super
end