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

Change default value for RemoveLoggerFactoryFilter to true #483

Closed
snakefoot opened this issue Feb 28, 2021 · 2 comments · Fixed by #521
Closed

Change default value for RemoveLoggerFactoryFilter to true #483

snakefoot opened this issue Feb 28, 2021 · 2 comments · Fixed by #521
Milestone

Comments

@snakefoot
Copy link
Contributor

See also #482

@snakefoot snakefoot added this to the 5.0 milestone Feb 28, 2021
@snakefoot snakefoot changed the title Change default value for ClearLoggerFilterOptions to true Change default value for ResetLoggerProviderFilter to true Feb 28, 2021
@snakefoot snakefoot changed the title Change default value for ResetLoggerProviderFilter to true Change default value for RemoveLoggerFactoryFilter to true Mar 1, 2021
@snakefoot
Copy link
Contributor Author

One might be surprised when doing this:

   ILogger<Program> logger = LoggerFactory.Create(builder => {
          builder.SetMinimumLevel(LogLevel.Warning);  // Explicit LogLevel will not apply to NLog
          builder.AddNLog();
        }).CreateLogger<Program>();
    logger.LogInformation("Hello World!");

@snakefoot
Copy link
Contributor Author

One could consider changing RemoveLoggerFactoryFilter from a boolean into LoggerFactoryMinimumLevel and when LogLevel.Trace, then it would be the same as RemoveLoggerFactoryFilter = true. And when assigned to (LogLevel?)null then it would be the same as RemoveLoggerFactoryFilter = false.

Thern this pull-request would be changing default-value for LoggerFactoryMinimumLevel from (LogLevel?)null to LogLevel.Trace.

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 a pull request may close this issue.

1 participant