From d2cacf53300e508f19d4c4d8217b82b2e0bf63e3 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 17 Mar 2020 12:22:58 +0100 Subject: [PATCH 1/2] Add comments for unusable log_level setting --- config/environments/production.rb | 2 +- config/environments/staging.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 91ff62a3be..7d30863699 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -33,7 +33,7 @@ Openfoodnetwork::Application.configure do # Use https in email links config.action_mailer.default_url_options = { protocol: 'https' } - # See everything in the log (default is :info) + # Note: This config no longer works with our new logging strategy # config.log_level = :debug # Configure logging for Rails 3.2: diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 91ff62a3be..7d30863699 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -33,7 +33,7 @@ Openfoodnetwork::Application.configure do # Use https in email links config.action_mailer.default_url_options = { protocol: 'https' } - # See everything in the log (default is :info) + # Note: This config no longer works with our new logging strategy # config.log_level = :debug # Configure logging for Rails 3.2: From e24d858af94d5cafb7ecb797a6801c8ec20ed9f1 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Tue, 17 Mar 2020 12:25:25 +0100 Subject: [PATCH 2/2] Ensure log level is the default :info for staging and production The default was being ignored in our new logging configuration, and the actual log output was way too high. This was causing serious disk space issues. --- config/environments/production.rb | 1 + config/environments/staging.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index 7d30863699..94b9418463 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -38,6 +38,7 @@ Openfoodnetwork::Application.configure do # Configure logging for Rails 3.2: config.logger = ActiveSupport::TaggedLogging.new(Logger.new(Rails.root.join("log", "#{Rails.env}.log"))) + config.logger.level = Logger::INFO config.logger.formatter = Logger::Formatter.new config.logger.datetime_format = "%Y-%m-%d %H:%M:%S" # Once we get to Rails 4.0, we can replace the above with: diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 7d30863699..94b9418463 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -38,6 +38,7 @@ Openfoodnetwork::Application.configure do # Configure logging for Rails 3.2: config.logger = ActiveSupport::TaggedLogging.new(Logger.new(Rails.root.join("log", "#{Rails.env}.log"))) + config.logger.level = Logger::INFO config.logger.formatter = Logger::Formatter.new config.logger.datetime_format = "%Y-%m-%d %H:%M:%S" # Once we get to Rails 4.0, we can replace the above with: