From 120ae3b9b6828e4c8a0be5dfe49590419fd79935 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 27 Nov 2025 07:24:41 +0100 Subject: [PATCH] Move structured logging to the engine --- saas/lib/fizzy/saas/engine.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/saas/lib/fizzy/saas/engine.rb b/saas/lib/fizzy/saas/engine.rb index cba86d9a8..3c8db7670 100644 --- a/saas/lib/fizzy/saas/engine.rb +++ b/saas/lib/fizzy/saas/engine.rb @@ -35,9 +35,13 @@ module Fizzy end end - initializer "fizzy_saas.logging.queenbee_id" do |app| + initializer "fizzy_saas.logging.session" do |app| ActiveSupport.on_load(:action_controller_base) do before_action do + if Current.identity.present? + logger.struct(" Authorized Identity##{Current.identity.id}", authentication: { identity: { id: Current.identity.id } }) + end + if Current.account.present? logger.struct(account: { queenbee_id: Current.account.external_account_id }) end