Skip to content

Commit

Permalink
Merge pull request #28493 from jmgarnier/backport-fix-to-remove-dupli…
Browse files Browse the repository at this point in the history
…cate-logging-output-from-rails-server

Backport fix duplicate rails server logging output in Rails 4-2-stable
  • Loading branch information
rafaelfranca committed Mar 20, 2017
2 parents 0501eef + 48220e8 commit 2597a20
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions railties/lib/rails/commands/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,13 @@ def create_tmp_directories
def log_to_stdout
wrapped_app # touch the app so the logger is set up

console = ActiveSupport::Logger.new($stdout)
console = ActiveSupport::Logger.new(STDOUT)
console.formatter = Rails.logger.formatter
console.level = Rails.logger.level

Rails.logger.extend(ActiveSupport::Logger.broadcast(console))
unless ActiveSupport::Logger.logger_outputs_to?(Rails.logger, STDOUT)
Rails.logger.extend(ActiveSupport::Logger.broadcast(console))
end
end
end
end

0 comments on commit 2597a20

Please sign in to comment.