Skip to content

Commit

Permalink
Heed RAILS_LOG_LEVEL in production config.
Browse files Browse the repository at this point in the history
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.`)
  • Loading branch information
sengi committed Jul 4, 2023
1 parent 2490b43 commit 79d676a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,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]
Expand Down

0 comments on commit 79d676a

Please sign in to comment.