Make log-level configurable in staging

The new comment and code come from the Rails 8.0 default files.
This commit is contained in:
Maikel Linke
2025-10-06 12:51:07 +11:00
parent 8c02bde7f2
commit 90cd2e0ba2
2 changed files with 3 additions and 5 deletions

View File

@@ -68,9 +68,7 @@ Rails.application.configure do
# Prepend all log lines with the following tags.
config.log_tags = [:request_id]
# "info" includes generic and useful information about system operation, but avoids logging too much
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
# want to log everything, set the level to "debug".
# Change to "debug" to log everything (including potentially personally-identifiable information!)
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
# Use a different cache store in production.

View File

@@ -35,8 +35,8 @@ Openfoodnetwork::Application.configure do
# Use https in email links
config.action_mailer.default_url_options = { protocol: 'https' }
# Set log level (default is :debug in Rails 4)
config.log_level = :info
# Change to "debug" to log everything (including potentially personally-identifiable information!)
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
# Configure logging:
config.log_formatter = Logger::Formatter.new.tap { |f| f.datetime_format = "%Y-%m-%d %H:%M:%S" }