cartodb-4.42/app/helpers/logger_controller_helper.rb
2024-04-06 05:25:13 +00:00

25 lines
493 B
Ruby

module LoggerControllerHelper
extend ActiveSupport::Concern
include ::LoggerHelper
def log_rescue_from(hook_id, exception)
log_info(message: 'Captured exception in rescue_from hook', exception: exception, hook_id: hook_id)
end
private
def log_context
{
current_user: current_user&.username,
request_id: request.uuid,
controller: controller_id
}.with_indifferent_access
end
def controller_id
"#{self.class.name}##{action_name}"
end
end