No need to store a custom async local, the default logger factory can provide a scope implementation via the ISupportExternalScope and IExternalScopeProvider interfaces. See https://github.com/dotnet/runtime/blob/23919a4b58d888b92f5192576febf47b06942b2c/src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLoggerProvider.cs#L66 for more details and feel free to ping me (or I can send a PR if you agree 😄 )..
This automagically gets you features like dotnet/runtime#34305 when using the default logger factory instance.
cc @nblumhardt
No need to store a custom async local, the default logger factory can provide a scope implementation via the
ISupportExternalScopeandIExternalScopeProviderinterfaces. See https://github.com/dotnet/runtime/blob/23919a4b58d888b92f5192576febf47b06942b2c/src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLoggerProvider.cs#L66 for more details and feel free to ping me (or I can send a PR if you agree 😄 )..This automagically gets you features like dotnet/runtime#34305 when using the default logger factory instance.
cc @nblumhardt