lib/instana/frameworks/rails.rb in instana-1.213.0 vs lib/instana/frameworks/rails.rb in instana-1.213.1

- old
+ new

@@ -15,10 +15,14 @@ class Railtie < ::Rails::Railtie initializer 'instana.rack' do |app| # Configure the Instrumented Logger if ::Instana.config[:logging][:enabled] && !ENV.key?('INSTANA_TEST') logger = ::Instana::InstrumentedLogger.new('/dev/null') - Rails.logger.extend(ActiveSupport::Logger.broadcast(logger)) + if ::Rails::VERSION::STRING < "7.1" + Rails.logger.extend(ActiveSupport::Logger.broadcast(logger)) + else + Rails.logger.broadcast_to(logger) + end end if ::Instana.config[:tracing][:enabled] ::Instana.logger.debug "Instrumenting Rack" app.config.middleware.insert 0, ::Instana::Rack