Skip to content

Is there a way to add custom logger for API calls made through Semantic Kernel? #6714

Closed Answered by dmytrostruk
prajwalpyakurelMS asked this question in Q&A
Discussion options

You must be logged in to vote

@prajwalpyakurelMS You can use HttpClientHandler and it should work correctly, but I think for your scenario DelegatingHandler is a recommended way, because you can create a chain of delegating handlers where each handler could be responsible for logging, authentication. retry policies etc, while HttpClientHandler sits at the end of this chain and performs actual HTTP communication. This applies to HTTP communication in ASP.NET Web API, but you can use the same strategy in your app:
https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/http-message-handlers

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@prajwalpyakurelMS
Comment options

@dmytrostruk
Comment options

@prajwalpyakurelMS
Comment options

@dmytrostruk
Comment options

Answer selected by sophialagerkranspandey
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants