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

feat: attempt to resolve ILogger<T> directly from IServiceProvider first #70

Closed

Conversation

weitzhandler
Copy link
Member

This PR sets the LogExtensionPoint, so that when an ILogger<T> is requested, it'll first try to retrieve it first directly from the service provider.
This way, we can keep the filtering, console/debug providers, min-log level and other logging setting to the upper app-level configuration setup using ILogginBuilder with generic-host or another third party tool.

Related: #53

Copy link
Member

@jeromelaban jeromelaban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

If you want to override the default behavior of the AmbientLogger, you should be able to set a ServiceLocator.Current before the loggers get initialized, that way you can provide your own implementation of ILoggerFactory and get the behavior you need.

Is that the original intent ?

@jeromelaban
Copy link
Member

As for the build failing, it's most likely related to the recent changes in the hosted agents.

@weitzhandler
Copy link
Member Author

weitzhandler commented Apr 27, 2020

That worked.
Thank you!

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.

2 participants