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

Support for ILoggingBuilder #75

Closed
Kralizek opened this issue Mar 6, 2019 · 5 comments
Closed

Support for ILoggingBuilder #75

Kralizek opened this issue Mar 6, 2019 · 5 comments
Labels
feature-request A feature should be added or improved.

Comments

@Kralizek
Copy link

Kralizek commented Mar 6, 2019

Microsoft is discoraging using ILoggerFactory in favor of ILoggingBuilder.

// before
var factory = new LoggerFactory();
factory.AddConsole();

// now
services.AddLogging(logging => logging.AddConsole());

It would be great if we could get a variation of AddAWSProvider that accepts a ILoggingBuilder instead of ILoggerFactory as first parameter.

@klaytaybai klaytaybai added the feature-request A feature should be added or improved. label Mar 8, 2019
@klaytaybai
Copy link

Hi @Kralizek, thank you for the suggestion. We'll evaluate adding this.

@Kralizek
Copy link
Author

For those like me looking for a workaround, here it is:

logging.AddProvider(new AWSLoggerProvider(context.Configuration.GetAWSLoggingConfigSection()));

@qidydl
Copy link

qidydl commented Apr 26, 2019

The way the Microsoft logging infrastructure handles configuration is also a bit different, there's a lot of conventions there, e.g. everything being in the root "Logging" section, with provider-specific configuration being routed in based on the alias. I think filtering might also happen in the logging infrastructure, so specific providers don't necessarily need to reimplement filtering by log level. Microsoft's loggers are all under https://github.com/aspnet/Extensions/tree/master/src/Logging so the source there can be really useful.

@normj
Copy link
Member

normj commented Jun 26, 2019

I have created PR #90 to add support for ILoggingBuilder

@normj
Copy link
Member

normj commented Aug 6, 2019

Closing as this has shipped with the latest version.

@normj normj closed this as completed Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

4 participants