Skip to content

Commit

Permalink
Log environment using option value (puma#2799)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ags authored and JuanitoFatas committed Sep 9, 2022
1 parent 3b8d902 commit 78548cc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/puma/runner.rb
Expand Up @@ -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}"
Expand Down

0 comments on commit 78548cc

Please sign in to comment.