From bf2009f995dd8cf5cbe43908de18580d0e94e2e1 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 26 Oct 2012 16:18:39 -0700 Subject: Job consumer logs to Rails.logger by default --- railties/lib/rails/application/finisher.rb | 1 + railties/test/application/queue_test.rb | 1 + 2 files changed, 2 insertions(+) (limited to 'railties') diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index c520f7af9d..2d87b8594a 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -99,6 +99,7 @@ module Rails initializer :activate_queue_consumer do |app| if config.queue.class == ActiveSupport::Queue app.queue_consumer = config.queue_consumer || config.queue.consumer + app.queue_consumer.logger ||= Rails.logger if app.queue_consumer.respond_to?(:logger=) app.queue_consumer.start at_exit { app.queue_consumer.shutdown } end diff --git a/railties/test/application/queue_test.rb b/railties/test/application/queue_test.rb index b0b3cf18e9..219a35da35 100644 --- a/railties/test/application/queue_test.rb +++ b/railties/test/application/queue_test.rb @@ -78,6 +78,7 @@ module ApplicationTests assert_nil Rails.application.config.queue_consumer assert_kind_of ActiveSupport::ThreadedQueueConsumer, Rails.application.queue_consumer + assert_equal Rails.logger, Rails.application.queue_consumer.logger end test "attempting to marshal a queue will raise an exception" do -- cgit v1.2.3