From 19e7f65dd1857511cbfe358e24bd20d3965e7c5b Mon Sep 17 00:00:00 2001 From: eileencodes Date: Thu, 17 Dec 2015 15:22:18 -0500 Subject: Don't log Action Cable to STDOUT in development Logging Action Cable to STDOUT caused the development log to see double messages like this: ``` Started GET "/" for ::1 at 2015-12-17 15:21:34 -0500 Started GET "/" for ::1 at 2015-12-17 15:21:34 -0500 Processing by Rails::WelcomeController#index as HTML Processing by Rails::WelcomeController#index as HTML Rendered /welcome/index.html.erb (0.0ms) Rendered /welcome/index.html.erb (0.0ms) Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms) Completed 200 OK in 3ms (Views: 1.3ms | ActiveRecord: 0.0ms) ``` Now that Action Cable is part of Rails it doesn't need it's own logger and will log to STDOUT via the local dev server here: https://github.com/rails/rails/blob/master/railties/lib/rails/commands/server.rb --- actioncable/lib/action_cable/process/logging.rb | 2 -- actioncable/lib/action_cable/server/configuration.rb | 8 -------- 2 files changed, 10 deletions(-) (limited to 'actioncable') diff --git a/actioncable/lib/action_cable/process/logging.rb b/actioncable/lib/action_cable/process/logging.rb index 618ba7357a..72b1a080d1 100644 --- a/actioncable/lib/action_cable/process/logging.rb +++ b/actioncable/lib/action_cable/process/logging.rb @@ -8,5 +8,3 @@ EM.error_handler do |e| end Celluloid.logger = ActionCable.server.logger - -ActionCable.server.config.log_to_stdout if Rails.env.development? \ No newline at end of file diff --git a/actioncable/lib/action_cable/server/configuration.rb b/actioncable/lib/action_cable/server/configuration.rb index 5d65f5e0e9..935133cbba 100644 --- a/actioncable/lib/action_cable/server/configuration.rb +++ b/actioncable/lib/action_cable/server/configuration.rb @@ -20,14 +20,6 @@ module ActionCable @disable_request_forgery_protection = false end - def log_to_stdout - console = ActiveSupport::Logger.new($stdout) - console.formatter = @logger.formatter - console.level = @logger.level - - @logger.extend(ActiveSupport::Logger.broadcast(console)) - end - def channel_paths @channels ||= Dir["#{channels_path}/**/*_channel.rb"] end -- cgit v1.2.3