Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • This is exactly what I need, but I am not able to get it work. I have static main method in console application. I initialized() HttpRawTraceListener and also setup FinishedCommunication but when i execute HttpClient().PostAsync() nothing is catched :/ I am using .net framework 4.6.1 Commented Jul 8, 2020 at 13:40
  • Using HttpClient.PostAsync will result in a buffered read / lazy result on the response, which will not be part of the System.Net logging, so the end result is that the listener class won't be able to see the full response in order to finish the communication. Commented Jul 8, 2020 at 17:02
  • 1
    However, I could probably update the listener to just listen for that scenario and finish the communication anyway so you could see everything except the raw response body. Commented Jul 8, 2020 at 17:03
  • loved this idea and saw it mentioned in numerous places. however when i run this it throws null ref exceptions all through initialize method. on .net 4.5 framework, the internal system.net.logging type loads ok but it doesn't find any fields named: s_LoggingInitialized, s_LoggingEnabled, nor the property 'Web'. Commented Sep 5, 2020 at 5:33