SplunkLogger icon indicating copy to clipboard operation
SplunkLogger copied to clipboard

Add option to pass a HttpMessageHandler to the HttpClient

Open mwinkler opened this issue 3 years ago • 0 comments

This change allow to optionally pass a HttpMessageHandler to the used HttpClient inside the logger. Example:

var config = builder.Configuration.GetSection("Splunk").Get<SplunkLoggerConfiguration>();
var handler = new HttpClientHandler
{
     Proxy = new WebProxy("http://localhost:8080")
};
builder.Logging.AddProvider(new SplunkHECJsonLoggerProvider(config, null, handler));

To control, how the http client behaves and allows different use cases like adding a proxy, config ssl validation, ....

mwinkler avatar Sep 05 '22 07:09 mwinkler