Skip to content
Snippets Groups Projects
Commit 90918b82 authored by John Harris's avatar John Harris
Browse files

fix: active support 'log_rescued_responses' override fixed

parent 8210dc41
No related branches found
Tags 1.5.1
Loading
Pipeline #40348 failed
......@@ -39,6 +39,10 @@ module NexusSemanticLogger
NexusSemanticLogger::DatadogTracer.new(service)
logger.info('SemanticLogger initialised.', level: config.log_level)
config.after_initialize do
require("nexus_semantic_logger/extensions/action_dispatch/debug_exceptions") if defined?(::ActionDispatch::DebugExceptions)
end
end
def self.development(config)
......
# Log actual exceptions, not a string representation
require "action_dispatch"
module ActionDispatch
# Fork of the rails_semantic_logger DebugExceptions to fix its removal of the upstream 'log_rescued_responses' check.
# This allows applications to use the 'config.action_dispatch.log_rescued_responses' setting.
class DebugExceptions
private
undef_method :log_error
def log_error(request, wrapper)
return if !log_rescued_responses?(request) && wrapper.rescue_response?
ActiveSupport::Deprecation.silence do
ActionController::Base.logger.fatal(wrapper.exception)
end
end
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment