diff --git a/lib/rails_semantic_logger/engine.rb b/lib/rails_semantic_logger/engine.rb index 8e1863e..127046f 100644 --- a/lib/rails_semantic_logger/engine.rb +++ b/lib/rails_semantic_logger/engine.rb @@ -266,6 +266,12 @@ class Engine < ::Rails::Engine # Re-open appenders after Spring has forked a process Spring.after_fork { |_job| ::SemanticLogger.reopen } if defined?(Spring.after_fork) + # Re-open appenders after SolidQueue worker/dispatcher/scheduler has finished booting + SolidQueue.on_start { ::SemanticLogger.reopen } if defined?(SolidQueue.on_start) + SolidQueue.on_worker_start { ::SemanticLogger.reopen } if defined?(SolidQueue.on_worker_start) + SolidQueue.on_dispatcher_start { ::SemanticLogger.reopen } if defined?(SolidQueue.on_dispatcher_start) + SolidQueue.on_scheduler_start { ::SemanticLogger.reopen } if defined?(SolidQueue.on_scheduler_start) + console do |_app| # Don't use a background thread for logging SemanticLogger.sync!