From bd58969fb531c74eb0ced18ea13776cb14f09c6d Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 14 Oct 2025 12:19:11 +1100 Subject: [PATCH] Reduce test logging by default These logs are rarely checked, and can take up a lot of disk space. I wanted to reduce the dev log level too, but then realised it also affects the dev server stdout. So now the other suggestions seem like a good idea.. (eg link development.log to /dev/null) Oh well, this change will at least reduce one source of unnecessary disk usage in a default installation, so I think worth doing. --- config/environments/development.rb | 2 ++ config/environments/test.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index a72cf058cd..5e3a76153b 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -27,6 +27,8 @@ Rails.application.configure do # To override this, set the appropriate locale in .env[.*] file. config.time_zone = ENV.fetch("TIMEZONE", "UTC") + # Log level for dev server stdout and development.log file. + # Set the desired level in .env.development.local file. config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :debug) # Enable/disable caching. By default caching is disabled. diff --git a/config/environments/test.rb b/config/environments/test.rb index 5012931362..4042f0a351 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -66,8 +66,8 @@ Rails.application.configure do # Tell Active Support which deprecation messages to disallow. config.active_support.disallowed_deprecation_warnings = [] - # Change to reduce unecessary logging - config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :debug) + # Reduced logging by default; set the desired level in .env.test.local file. + config.log_level = ENV.fetch("RAILS_LOG_LEVEL", :fatal) # Fail tests on deprecated code unless it's a known case to solve. Rails.application.deprecators.behavior = ->(message, callstack, deprecator) do