diff options
Diffstat (limited to 'railties/lib/rails/commands/server.rb')
-rw-r--r-- | railties/lib/rails/commands/server.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/railties/lib/rails/commands/server.rb b/railties/lib/rails/commands/server.rb index d3ea441f8e..27cbaf360a 100644 --- a/railties/lib/rails/commands/server.rb +++ b/railties/lib/rails/commands/server.rb @@ -6,6 +6,8 @@ require 'rails' module Rails class Server < ::Rack::Server class Options + DEFAULT_PID_PATH = File.expand_path("tmp/pids/server.pid").freeze + def parse!(args) args, options = args.dup, {} @@ -91,7 +93,7 @@ module Rails environment: (ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development").dup, daemonize: false, caching: false, - pid: File.expand_path("tmp/pids/server.pid") + pid: Options::DEFAULT_PID_PATH }) end @@ -133,11 +135,13 @@ module Rails 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 |