I've noticed that my application(service) that supposed to run in a backgraund creates a log of garbage logging information because of HttpClient, like so:
info: System.Net.Http.HttpClient.Default.LogicalHandler[100] Start processing HTTP request POST https://localhost:44317/programmatic/getcontent info: System.Net.Http.HttpClient.Default.ClientHandler[100] Sending HTTP request POST https://localhost:44317/programmatic/getcontent info: System.Net.Http.HttpClient.Default.ClientHandler[101] Received HTTP response after 3027.6345ms - OK info: System.Net.Http.HttpClient.Default.LogicalHandler[101] End processing HTTP request after 3028.2987ms - OK info: System.Net.Http.HttpClient.Default.ClientHandler[101] Received HTTP response after 3052.4709ms - OK info: System.Net.Http.HttpClient.Default.LogicalHandler[101] End processing HTTP request after 3053.467ms - OK
Is there a way to configure it anywhere?
I inject client factory like this:
serviceCollection.AddHttpClient();
And then create a client like this:
HttpClient client = _clientFactory.CreateClient();