From 260b6cdd21ed0a06ecd2790e085abc7521310f17 Mon Sep 17 00:00:00 2001 From: Pieter Verschaffelt Date: Fri, 11 Aug 2023 09:08:01 +0200 Subject: [PATCH] Limit Rails log files to 500MiB in production --- config/environments/production.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index 04dee56..d51ea7a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -77,6 +77,7 @@ # Use a different logger for distributed setups. # require "syslog/logger" # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") + config.logger = ActiveSupport::Logger.new(config.paths["log"].first, 1, 500 * 1024 * 1024) # 50 MB if ENV["RAILS_LOG_TO_STDOUT"].present? logger = ActiveSupport::Logger.new(STDOUT)