Design generic request logging feature
calebkiage opened this issue · 0 comments
calebkiage commented
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 theMicrosoft.Extensions.DependencyInjection
library. Other clients might not want these dependencies, or may want to plug in other logging mechanisms. e.g. simpleConsole.WriteLine
orNLog
.
- The graph cli uses the
- 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?
- The graph cli uses a single instance of the default
Discussion: microsoftgraph/msgraph-cli-core#236