I'm injecting typed HTTP clients in a .NET Core app. I'm also logging with Serilog. I have not intentionally configured any logging of HTTP activity. It magically came with. How do I turn this off?
[12:00:52 INF] Start processing HTTP request POST https://foo/bar
[12:00:52 INF] Sending HTTP request POST https://foo/bar
[12:00:53 INF] Received HTTP response after 707.8906ms - OK
My HTTP client configuration:
services.AddHttpClient("FOO")
.ConfigureHttpClient(client =>
{
client.BaseAddress = new Uri("https://foo/");
})
.ConfigurePrimaryHttpMessageHandler(sp => new HttpClientHandler()
{
Credentials = new NetworkCredential("user", "pass"),
ServerCertificateCustomValidationCallback = (senderC, cert, chain, sslPolicyErrors) => true
})
.AddTypedClient<Thing1>()
.AddTypedClient<Thing2>();