From 93d3e633fc5a95a82f694f5b3550ecc56a4c9f16 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Wed, 12 Jan 2022 12:38:24 +1100 Subject: [PATCH] Log environment using option value It's possible for the configured environment to be something other than `RACK_ENV`, e.g. `APP_ENV` or `RAILS_ENV`, but the runner will always log the value of `RACK_ENV`. This changes the log output to show the configured environment value. See https://github.com/puma/puma/blob/v5.5.2/lib/puma/configuration.rb#L203 --- lib/puma/runner.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/puma/runner.rb b/lib/puma/runner.rb index 3dd598aeed..ed75a52d14 100644 --- a/lib/puma/runner.rb +++ b/lib/puma/runner.rb @@ -94,12 +94,13 @@ def ruby_engine def output_header(mode) min_t = @options[:min_threads] max_t = @options[:max_threads] + environment = @options[:environment] log "Puma starting in #{mode} mode..." log "* Puma version: #{Puma::Const::PUMA_VERSION} (#{ruby_engine}) (\"#{Puma::Const::CODE_NAME}\")" log "* Min threads: #{min_t}" log "* Max threads: #{max_t}" - log "* Environment: #{ENV['RACK_ENV']}" + log "* Environment: #{environment}" if mode == "cluster" log "* Master PID: #{Process.pid}"