System.Net Tracing collection Steps


Ask:
System.Net Tracing is very helpful to review SSL/TLS and socket level connection/communication failure.

To enabled tracing:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.HttpListener">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
<source name="System.Net.Cache">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
</sources>
<sharedListeners>
<add
name="System.Net"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:\traces\System.Net.trace.log"
traceOutputOptions="DateTime"
/>
</sharedListeners>
<switches>
<add name="System.Net" value="Verbose" />
<add name="System.Net.Sockets" value="Verbose" />
<add name="System.Net.Cache" value="Verbose" />
<add name="System.Net.HttpListener" value="Verbose" />
</switches>
</system.diagnostics>
</configuration>

Trace Location:
Set the below path.
initializeData="c:\traces\System.Net.trace.log"

To review:
I would recommend using Notepad++.
Few pointers:

WCF: Troubleshooting Socket Abort Errors

WCF: Review System.Net and Network traces for Windows Authentication/Delegation based troubleshooting

Use System.Net Trace and SSL Alert Protocol to troubleshoot SSL connection issue.

I hope this helps!
Saurabh Somani


Comments (0)

Skip to main content