Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Offer a better way to configure logging for DI scenarios #397

Closed
kevinchalet opened this issue Mar 25, 2016 · 2 comments
Closed

Offer a better way to configure logging for DI scenarios #397

kevinchalet opened this issue Mar 25, 2016 · 2 comments

Comments

@kevinchalet
Copy link

Currently, you have to inject ILoggerFactory in your Configure method and call AddDebug/AddConsole to register the listeners you want to add in your application. This is a weird pattern, that clearly differs from all the other stacks, that use IServiceCollection extensions for that.

That would be great if we could do something like that:

public void ConfigureServices(IServiceCollection services) {
    services.AddLogging(options => {
        options.AddDebug();
        options.AddConsole();
    });
}

/cc @davidfowl @muratg

@herecydev
Copy link

Basically this, no?

@kevinchalet
Copy link
Author

Yep, exactly that, thanks! 👏
Closing as a duplicate of #346.

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

No branches or pull requests

2 participants