From 3c2e7b8ae34911f12e65462f98cd7bd23d7cd771 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Thu, 13 Mar 2025 09:31:11 -0400 Subject: [PATCH] logging: suppress log entries that are not structured Borrowed from the BC4 configuration. --- config/environments/production.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index 4fd23bc8e..65454c581 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -50,6 +50,10 @@ Rails.application.configure do .tap { |logger| logger.formatter = ::Logger::Formatter.new } .then { |logger| ActiveSupport::TaggedLogging.new(logger) } + # No normal logs. Suppress everything that's not structured. + config.logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(nil)) + config.log_level = :fatal + # Structured JSON logging config.structured_logging.logger = ActiveSupport::Logger.new(STDOUT)