mattwcole / gelf-extensions-logging

GELF provider for Microsoft.Extensions.Logging
MIT License
109 stars 42 forks source link

HttpClient - HttpGelfClient #38

Closed thiagoloureiro closed 5 years ago

thiagoloureiro commented 5 years ago

Hi @mattwcole ,

On HttpGelfClient shouldn't we use a static httpClient? To avoid opening and closing connections, even if it's disposed takes a while to close the connection

See:

https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/

Thanks!

mattwcole commented 5 years ago

Hi, the HttpClient instance is a singleton. It has the same lifetime as HttpGelfClient which has the same lifetime as GelfLoggerProvider which is registered as a singleton here.

thiagoloureiro commented 5 years ago

Ah cool! Sorry didn’t noticed that! We can close it . Thanks for the good work in here mate, I’m starting to use this package in a big project ✌🏻

Sent from my iPhone

On 1 Oct 2019, at 3:20 pm, Matt Cole notifications@github.com wrote:

 Hi, the HttpClient instance is a singleton. It has the same lifetime as HttpGelfClient which has the same lifetime as GelfLoggerProvider which is registered as a singleton here.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mattwcole commented 5 years ago

No problem, good luck with the project! 👍