Wednesday, September 4, 2013

How to: turn on the logging for System.Net in C# 4.0

If you checked the code in HttpWebRequest by reflector, you might found it has a lot logging support code

image

sometimes, you do want to check the request behavior on sockets, http level, you can simply turn on the logging. here is a quick how,
change your config to somehow like this,
image

when you run the app with the httprequest  request , you will see the detailed logging

image

different trace listeners in a nutshell:

image

No comments:

 
Locations of visitors to this page