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

Configuration and Filtering changes #565

Closed
10 tasks done
BrennanConroy opened this issue Mar 7, 2017 · 2 comments
Closed
10 tasks done

Configuration and Filtering changes #565

BrennanConroy opened this issue Mar 7, 2017 · 2 comments

Comments

@BrennanConroy
Copy link
Member

BrennanConroy commented Mar 7, 2017

  • Add void AddProvider(string providerName, ILoggerProvider provider) to LoggerFactory
  • LoggerFactory(IConfiguration config) will be the way to add configuration to our factory
  • Support named providers
    • Check typeof(type).FullName
    • Name passed into AddProvider wins always
  • Example format:
{
  "Logging": { // default values unless otherwise specified
    "LogLevel": {
        "System": "Trace"
    },
    "Console": {
        "LogLevel": {
          "Microsoft.Extensions": "Warning"
        }
    },
    "CustomProvider": { // e.g. factory.AddProvider("CustomProvider", new MyCustomProvider())
      "LogLevel": {
        "System": "Information"
      }
    }
  }
}

- [ ] Remove ability to call AddProvider whenever you want, only allowed during startup

  • Obsolete AddConsole(this ILoggerFactory factory, IConfiguration configuration)

Figure this out:

  • Obsolete void AddProvider(ILoggerProvider provider) on ILoggerFactory

Stretch goal:

  • Add AddFilter(string providerName, Func<string, LogLevel, bool> filter) to LoggerFactory
    • AddFilter is additive
@cwe1ss
Copy link
Contributor

cwe1ss commented Mar 22, 2017

Will you react to changes in the underlying configuration system?

My desired scenario: Configuration is loaded from an external system like Consul. I want to be able to change the logging configuration in-flight without having to restart the application.

@BrennanConroy
Copy link
Member Author

Yeah, we will handle config changes at runtime.

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

No branches or pull requests

3 participants