Log4Net.Async icon indicating copy to clipboard operation
Log4Net.Async copied to clipboard

Referenced HttpContext is not guaranteed to be valid.

Open Vycka opened this issue 5 years ago • 0 comments

https://github.com/cjbhaines/Log4Net.Async/blob/122bface9668ea325203426f31ba037ce29d8698/src/Log4Net.Async/AsyncForwardingAppenderBase.cs#L30 https://github.com/cjbhaines/Log4Net.Async/blob/122bface9668ea325203426f31ba037ce29d8698/src/Log4Net.Async/ParallelForwardingAppender.cs#L200 There are no guarantees that HttpContext is still gonna be valid when client closes connection. And at least using it with heavy-loaded Kestrel it seems to be always the case and results logging not working at all. There are also no guarantees that logging is gonna be used in environment where HttpContext even exists. And HttpContext here seems to be only used for throwing exceptions and the need of it probably can just be removed.

Vycka avatar Sep 11 '20 08:09 Vycka