DEV: Remove autoloading in initializers depreciation message.

DEV: Remove autoloading in initializers depreciation message.

diff --git a/config/initializers/100-logster.rb b/config/initializers/100-logster.rb
index 4cc19f1..bbc23b5 100644
--- a/config/initializers/100-logster.rb
+++ b/config/initializers/100-logster.rb
@@ -19,13 +19,15 @@ if Rails.env.development? && RUBY_VERSION.match?(/^2\.5\.[23]/)
 end
 
 if Rails.env.development? && !Sidekiq.server? && ENV["RAILS_LOGS_STDOUT"] == "1"
-  console = ActiveSupport::Logger.new(STDOUT)
-  original_logger = Rails.logger.chained.first
-  console.formatter = original_logger.formatter
-  console.level = original_logger.level
-
-  unless ActiveSupport::Logger.logger_outputs_to?(original_logger, STDOUT)
-    original_logger.extend(ActiveSupport::Logger.broadcast(console))
+  Rails.application.config.after_initialize do
+    console = ActiveSupport::Logger.new(STDOUT)
+    original_logger = Rails.logger.chained.first
+    console.formatter = original_logger.formatter
+    console.level = original_logger.level
+
+    unless ActiveSupport::Logger.logger_outputs_to?(original_logger, STDOUT)
+      original_logger.extend(ActiveSupport::Logger.broadcast(console))
+    end
   end
 end
 

GitHub sha: c697efc1

This commit appears in #12957 which was approved by lis2. It was merged by tgxworld.