FEATURE: log to STDOUT using Rails 5 env var (#18880)

Rails introduced a environment variables RAILS_LOG_TO_STDOUT in the
template for new projects here: https://github.com/rails/rails/pull/23734

This commit adds the same code to the discourse production environment,
making it easy to configure logging to stdout in production for
environments which already support log collection via stdout.
This commit is contained in:
Benno Fünfstück 2023-03-01 00:06:14 +01:00 committed by GitHub
parent 5be13f5002
commit 24188beaaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,4 +67,8 @@ Discourse::Application.configure do
end
config.active_record.dump_schema_after_migration = false
if ENV["RAILS_LOG_TO_STDOUT"].present?
config.logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))
end
end