Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IExternalScopeProvider for logging scopes #36

Closed
davidfowl opened this issue Oct 7, 2020 · 1 comment · Fixed by #37
Closed

Use IExternalScopeProvider for logging scopes #36

davidfowl opened this issue Oct 7, 2020 · 1 comment · Fixed by #37

Comments

@davidfowl
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants