]> git.openstreetmap.org Git - rails.git/commitdiff
Re-enable support for logging to a file in production master live
authorTom Hughes <tom@compton.nu>
Mon, 24 Mar 2025 17:36:42 +0000 (17:36 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 24 Mar 2025 17:37:55 +0000 (17:37 +0000)
config/environments/production.rb

index 088412086c6ba8f7f3a3374bdc5d7183eebeaca2..9fc2f1800c4f89e05d873b19e5d035765181e68b 100644 (file)
@@ -35,7 +35,11 @@ Rails.application.configure do
 
   # Log to STDOUT with the current request id as a default log tag.
   config.log_tags = [:request_id]
-  config.logger   = ActiveSupport::TaggedLogging.logger($stdout)
+  config.logger   = if Settings.key?(:log_path)
+                      ActiveSupport::TaggedLogging.logger(Settings.log_path)
+                    else
+                      ActiveSupport::TaggedLogging.logger($stdout)
+                    end
 
   # Change to "debug" to log everything (including potentially personally-identifiable information!)
   config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")