Skip to content

Commit

Permalink
Merge pull request #34554 from sj26/group-exception-logs
Browse files Browse the repository at this point in the history
Log exceptions atomically
  • Loading branch information
rafaelfranca committed Nov 28, 2018
2 parents 7d0c8eb + acbc0e0 commit 17abc66
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
Expand Up @@ -180,11 +180,14 @@ def log_error(request, wrapper)
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.concat(exception.annoted_source_code) if exception.respond_to?(:annoted_source_code)
message << " "
message.concat(trace)

log_array(logger, message)
end
end

Expand Down

0 comments on commit 17abc66

Please sign in to comment.