diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action_cable/process/logging.rb | 2 | ||||
-rw-r--r-- | lib/action_cable/server/configuration.rb | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/action_cable/process/logging.rb b/lib/action_cable/process/logging.rb index bcceff4bec..827a58fdb8 100644 --- a/lib/action_cable/process/logging.rb +++ b/lib/action_cable/process/logging.rb @@ -4,3 +4,5 @@ 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/lib/action_cable/server/configuration.rb b/lib/action_cable/server/configuration.rb index ac9fa7b085..4808d170ff 100644 --- a/lib/action_cable/server/configuration.rb +++ b/lib/action_cable/server/configuration.rb @@ -18,6 +18,14 @@ module ActionCable @channels_path = Rails.root.join('app/channels') 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 |