c0shea / Seq.Client.EventLog

Writes Windows Event Log entries to Seq
MIT License
33 stars 13 forks source link

HttpClient should be a singleton #1

Closed epignosisx closed 5 years ago

epignosisx commented 5 years ago

The .NET team recommendation is that HttpClient should not be created and disposed right away, rather they should be reused:

https://blogs.msdn.microsoft.com/shacorn/2016/10/21/best-practices-for-using-httpclient-on-services/

Issues that could arise from the current usage:

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

https://github.com/c0shea/Seq.Client.EventLog/blob/8ac56872a44416dadaabb399a38560497b15e0f9/src/Seq.Client.EventLog/EventLogListener.cs#L104