serilog-contrib / serilog-sinks-splunk

A Serilog sink that writes to Splunk
https://splunk.com
Apache License 2.0
46 stars 47 forks source link

Is there any option to set http timeout for Collector #164

Closed joseviniciusnunes closed 6 months ago

joseviniciusnunes commented 1 year ago

Hi guys

Testing in my application I realized that if the splunk presents instability, the .dispose() is waiting forever.

A timeout option would be appreciated, thanks!

jpfifer commented 7 months ago

If you need a short term approach installing an HttpMessageHandler at log creation time would allow you to effectively set a timeout by creating a cancellation token with a fixed time.

EEParker commented 6 months ago

@jpfifer has listed current solution correct, e.g. HttpMessageHandler parameter of .WriteTo.EventCollector.