You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
493 B

6 months ago
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