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] 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: