Friday, June 13, 2008

Integrating tracing on network events and communication

I've been using MS network monitor and Fiddler for quite a long time now, but following post http://blogs.msdn.com/drnick/archive/2008/06/10/tracing-network-calls.aspx  by Nicholas Allen forced me to try to see what actually is going to be logged if network sources will be enabled.

Suggested sources names are defined inside internal Logging class of System.Net: 

    private const string TraceSourceCacheName = "System.Net.Cache";
    private const string TraceSourceHttpListenerName = "System.Net.HttpListener";
    private const string TraceSourceSocketsName = "System.Net.Sockets";
    private const string TraceSourceWebName = "System.Net"; 

Lets see what is the outcome of simple usage of a HttpWebRequest to http://www.google.com:

image

This was System.Net, you can see request/response headers here, but no raw data sent over and back. Lets see the output of System.Net.Sockets:

image

This source provides us with complete details of communication on the wire.

Leaving System.Net.Cache and System.Net.HttpListener for the next time.

No comments: