-
Notifications
You must be signed in to change notification settings - Fork 245
Configuring logging from appSettings.json #437
Comments
Thanks @RehanSaeed. Looks like an additive chance, so putting into 1.0.1 milestone for further discussion post RTM. |
This example shows well that the existing providers are really fragmented in terms of filtering and configuration. Providers should not be responsible for implementing this on their own. this makes creating new providers way too complicated. If you want to improve this library, you should make file-based configuration and filtering a single, centralized responsibility (e.g. remove the provider-specific filters in favor of the new filter-package or create some other integrated solution) However, I'm in favor of not improving the providers and instead focusing on making the integration with 3rd party loggers better. :) |
I would like to see a way to configure log levels from appsettings.json using WithFilter (FilterLoggerSettings) as I currently have to hardcode the loglevels. I am using SeriLog and as such have no use for the AddConsole output feature. But I do need the filtering. |
cc @davidfowl |
Having a LoggingFilter app settings configuration with overrides for specific providers would be nice. |
Looking at the current docs I'm confused. Is there a way to do something like this?
which can then be used like: given that my appsettings.json contains the standard block in the first message in this thread? That'd be pretty handy instead of having to read the json myself and then creating the IFilterLoggerSettings instance, i.e: NOT having to do this.
|
@joelmartinez totally agree, you should probably add a feature request for that. Shouldn't be too hard to do as it is already done for console logging |
@muratg @Eilon @DamianEdwards Lets add this to the 2.0.0 milestone. |
Yeah this is a reasonable feature request. Will have to look at what else we have for 2.0.0, but this one seems fairly bite-sized. |
👍 |
@pakrym is this bug still necessary with the changes you're working on? |
Yes, there would be global filter configuration. |
Fixed by #626 |
The Console logger has the following method which allows you to configure it from the appSettings.json file:
Why do the Debug, EventLog and other loggers not have similar overloads? What was the intention behind that decision. In my case, I would like a configuration section in the JSON for each log provider so that they could be configured independently. What would be the best way to achieve this?
The text was updated successfully, but these errors were encountered: