diff --git a/lib/active_storage/migrator.rb b/lib/active_storage/migrator.rb index e439cd457..8e34e96c5 100644 --- a/lib/active_storage/migrator.rb +++ b/lib/active_storage/migrator.rb @@ -1,11 +1,7 @@ require 'yaml' require 'erb' -require 'logger' class ActiveStorage::Migrator - Rails.logger = Logger.new($stdout) - Rails.logger.level = Logger::DEBUG - def self.migrate(from_service_name, to_service_name, update_service_name: true) configs = load_storage_config # Check if services are configured correctly diff --git a/spec/lib/active_storage/migrator_spec.rb b/spec/lib/active_storage/migrator_spec.rb index 4249e4d4e..f588d5a4d 100644 --- a/spec/lib/active_storage/migrator_spec.rb +++ b/spec/lib/active_storage/migrator_spec.rb @@ -24,6 +24,14 @@ RSpec.describe ActiveStorage::Migrator do described_class.migrate('local', 'amazon', update_service_name: false) end + + it 'does not override the application logger' do + allow(described_class).to receive(:migrate_blobs) + + expect(Rails).not_to receive(:logger=) + + described_class.migrate('local', 'amazon') + end end context 'when services are not configured correctly' do