Merge pull request #301 from basecamp/flavorjones-structured-log-tenant

Structured logs for controller actions now contain the tenant
This commit is contained in:
Mike Dalessio
2025-03-13 17:22:54 -04:00
committed by GitHub
+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