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

Add option to remove other loggers #192

Closed
304NotModified opened this issue Oct 7, 2017 · 2 comments
Closed

Add option to remove other loggers #192

304NotModified opened this issue Oct 7, 2017 · 2 comments
Labels
ASP.NET Core ASP.NET Core - all versions
Milestone

Comments

@304NotModified
Copy link
Member

On by Default

.ConfigureLogging((context, logging) =>
{
    // clear all previously registered providers
    logging.ClearProviders();

    // now register everything you *really* want
    // …
});
@snakefoot
Copy link
Contributor

snakefoot commented Nov 15, 2019

Alternative have option that replaces the current LoggerFactory with the NLog LoggerFactory. Then all other providers will automatically be removed.

It will also have the extra side-effect that only NLog-Logging-Rules has effect, so it is simpler to diagnose (Not being confused by environment-specific appsettings.json files).

@snakefoot
Copy link
Contributor

Resolved by #657 that adds the option ReplaceLoggerFactory (And RemoveLoggerFactoryFilter that will become enabled by default with ver. 5)

@snakefoot snakefoot modified the milestones: 5.0, 4.12 Mar 30, 2021
@snakefoot snakefoot added ASP.NET Core ASP.NET Core - all versions ASP.NET Core 2 and removed ASP.NET Core ASP.NET Core - all versions labels Mar 30, 2021
@snakefoot snakefoot added ASP.NET Core ASP.NET Core - all versions and removed ASP.NET Core 2 labels Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ASP.NET Core ASP.NET Core - all versions
Projects
None yet
Development

No branches or pull requests

2 participants