System.Net network tracing doesn't work in .net app
Siv Siri
21
Reputation points
System.Net network tracing doesn't work in .net app
This is the only output is see in the log file. I made sure the TRACE is enabled :
System.Net Information: 0 : [23592] Current OS installation type is 'Client'.
ProcessId=25132
DateTime=2022-03-30T17:49:56.1303174Z
System.Net Information: 0 : [17404] Current OS installation type is 'Client'.
ProcessId=264
DateTime=2022-03-30T17:50:37.3832981Z
This is the diagnostics section from my web.config file.
<system.diagnostics>
<sources>
<source name="System.Net" tracemode="includehex" maxdatasize="1024">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
<source name="System.Net.Cache">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
<source name="System.Net.Http">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
<source name="System.Net.Sockets">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
<source name="System.Net.WebSockets">
<listeners>
<add name="MyTraceFile"/>
</listeners>
</source>
</sources>
<switches>
<add name="System.Net" value="Verbose"/>
<add name="System.Net.Cache" value="Verbose"/>
<add name="System.Net.Http" value="Verbose"/>
<add name="System.Net.Sockets" value="Verbose"/>
<add name="System.Net.WebSockets" value="Verbose"/>
</switches>
<sharedListeners>
<add name="MyTraceFile"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="network.log"
traceOutputOptions="ProcessId, DateTime"
/>
</sharedListeners>
<trace autoflush="true"/>
</system.diagnostics>
Environment - .NET 4.7.2
Sign in to answer