From 0b2c49aa4dad73d2af098bbbd545c05ed2ace3cd Mon Sep 17 00:00:00 2001
From: Samuel Cochran <sj26@sj26.com>
Date: Wed, 28 Nov 2018 16:45:31 +1100
Subject: Log exceptions atomically

When distributed over multiple logger calls the lines can become
intermixed with other log statements. Combining them into a single
logger call makes sure they always get logged together.
---
 .../lib/action_dispatch/middleware/debug_exceptions.rb      | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

(limited to 'actionpack/lib')

diff --git a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
index 5f5fdbc66a..61e7e73a68 100644
--- a/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
+++ b/actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
@@ -180,11 +180,14 @@ module ActionDispatch
         trace = wrapper.framework_trace if trace.empty?
 
         ActiveSupport::Deprecation.silence do
-          logger.fatal "  "
-          logger.fatal "#{exception.class} (#{exception.message}):"
-          log_array logger, exception.annoted_source_code if exception.respond_to?(:annoted_source_code)
-          logger.fatal "  "
-          log_array logger, trace
+          message = []
+          message << "  "
+          message << "#{exception.class} (#{exception.message}):"
+          message += exception.annoted_source_code if exception.respond_to?(:annoted_source_code)
+          message << "  "
+          message += trace
+
+          log_array(logger, message)
         end
       end
 
-- 
cgit v1.2.3