Structured logs for controller actions now contain the tenant

This commit is contained in:
Mike Dalessio
2025-03-13 16:51:12 -04:00
parent f4c7167316
commit e08f073d73
+4
View File
@@ -2,3 +2,7 @@ Rails.application.configure do |config|
# uuugh this resolver proc is so gross.
config.middleware.use ActiveRecord::Tenanted::TenantSelector, "ApplicationRecord", ->(request) { request.subdomain.split(".").first }
end
ActiveSupport.on_load(:action_controller_base) do
before_action { logger.struct tenant: ApplicationRecord.current_tenant }
end