diff --git a/config/environments/production.rb b/config/environments/production.rb index 47ee2f0016..e6ff7105a7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -52,6 +52,7 @@ # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). config.log_level = :info + config.log_format = :json # Prepend all log lines with the following tags. config.log_tags = [:request_id] @@ -77,9 +78,12 @@ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") if ENV["RAILS_LOG_TO_STDOUT"].present? - logger = ActiveSupport::Logger.new($stdout) - logger.formatter = config.log_formatter - config.logger = ActiveSupport::TaggedLogging.new(logger) + $stdout.sync = true + config.rails_semantic_logger.add_file_appender = false + config.semantic_logger.add_appender( + io: $stdout, + formatter: config.rails_semantic_logger.format, + ) end # Do not dump schema after migrations.