Skip to content

Fix minimum level overrides in reloadable loggers #43

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

Merged
merged 2 commits into from
Mar 3, 2021

Conversation

nblumhardt
Copy link
Member

Ensures that wrapped loggers have a chance to observe the value of SourceContext properties. Previous behavior was to preemptively construct enrichers, which are opaque to the wrapped logger.

This PR skips the preemptive enricher construction for types that are "safe" to hang onto in closures, including the strings ultimately used for SourceContext.

Fixes #42 .

@nblumhardt
Copy link
Member Author

Also sending this fix through the pipeline for the downstream Serilog.AspNetCore release. Test coverage in the newer code isn't great - looking forward to bulking it up a bit in the near future :-)

@nblumhardt nblumhardt merged commit bc44a18 into serilog:dev Mar 3, 2021
@nblumhardt nblumhardt mentioned this pull request Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CreateBootstrapLogger() does not appear to respect MinimumLevel.Override()
1 participant