I'm trying to add more detailed error logging to my application, that logs the current page url whenever a circuit crashes. One way of doing this is to override the OnCircuitClosedAsync
method in a custom CircuitHandler
, however I don't know how to correlate a circuit id string with an active user session.
I know I can keep track of users in the CircuitHandler by injecting an IHttpContextAccessor
(see this answer), but a user can have multiple tabs open, or even have multiple concurrent login sessions, and I need to know exactly which circuit id is assigned to each individual page component.
Is there a way to get the current circuit id from a Blazor component, even if the same user has multiple tabs open (i.e. multiple circuits associated with their account)?