microsoft/kiota-cli-commons

Design generic request logging feature

calebkiage opened this issue · 0 comments

The microsoftgraph/msgraph-cli has a feature to log requests sent and responses received when a user provides the --debug option. It would be nice to have the feature available to all kiota generated clients.

Open questions:

  • What logging library should be used?
    • The graph cli uses the Microsoft.Extensions.Logging library which in turn requires the Microsoft.Extensions.DependencyInjection library. Other clients might not want these dependencies, or may want to plug in other logging mechanisms. e.g. simple Console.WriteLine or NLog.
  • How will this work with multiple http clients?
    • The graph cli uses a single instance of the default System.Net.Http.HttpClient. A logging handler is hooked onto that instance. If clients use a different Http client library, how will that extensibility be offered?

Discussion: microsoftgraph/msgraph-cli-core#236