From 40792bd456d143b9d12cd8fad44cf6d73d8162c0 Mon Sep 17 00:00:00 2001 From: Chris Banks Date: Tue, 4 Jul 2023 11:32:07 +0100 Subject: [PATCH] Heed RAILS_LOG_LEVEL in production config. This was added to Rails's template for production.rb in https://github.com/rails/rails/blob/3b83758/railties/lib/rails/generators/rails/app/templates/config/environments/production.rb.tt#L73 We want to be able to control the log level this way so that: - we don't have to rebuild an app just to change its log level - we can enable debug logging if we need it to investigate a problem that's hard to reproduce - we can tune the log levels so as not to waste resources logging things that we don't care about the rest of the time - if a change to an app introduces a problem with logspew, we can just dial down the log level while someone tracks down the underlying issue This is a bulk change; all 43 PRs are identical except for apps which had their loglevel set to `debug`, which we're resetting to `info` as the default. To approve, use https://github.com/alphagov/bulk-merger (`./review 'Heed RAILS_LOG_LEVEL in production config.`) --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 5f569971e..4517a7ed3 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -49,7 +49,7 @@ # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). - config.log_level = :info + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :info) # Prepend all log lines with the following tags. config.log_tags = [:request_id]