Sladescross's Blog

Blogging about Sharepoint related stuff

System.Net Tracing February 13, 2012

Filed under: System.NET Tracing,Tracing,WPF Tracing — sladescross @ 9:23 pm

http://msdn.microsoft.com/en-us/library/bb885203.aspx

asmx tracing.

http://msdn.microsoft.com/en-us/library/ms733025.aspx

WCF tracing

<system.diagnostics>

<sources>

<source name=”System.Net” tracemode=”includehex” maxdatasize=”1024″>

<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>

<source name=”System.ServiceModel.MessageLogging” switchValue=”Warning, ActivityTracing, Verbose” >

<listeners><add name=”ServiceModelTraceListener”/>

</listeners>

</source>

<source name=”System.ServiceModel” switchValue=”Warning,ActivityTracing”>

<listeners>

<add name=”ServiceModelTraceListener”/>

</listeners>

</source>

<source name=”System.Runtime.Serialization” switchValue=”Warning,ActivityTracing”>

<listeners>

<add name=”ServiceModelTraceListener”/>

</listeners>

</source>

<source name=”System.Web.Services.Asmx”>

<listeners>

<add name=”AsmxTraceFile” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”C:\temp\asmx.log” traceOutputOptions=”LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId” />

</listeners>

</source>

</sources>

<switches>

<add name=”System.Net” value=”Verbose”/>

<add name=”System.Net.Sockets” value=”Verbose”/>

<add name=”System.Net.Cache” value=”Verbose”/>

<add name=”System.Web.Services.Asmx” value=”Verbose”  />

</switches>

<sharedListeners>

<add name=”System.Net” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”C:\temp\network.log”/>

<add initializeData=”C:\temp\wpf.svclog” type=”System.Diagnostics.XmlWriterTraceListener” name=”ServiceModelTraceListener” traceOutputOptions=”Timestamp”/>

</sharedListeners>

<trace autoflush=”true”/>

</system.diagnostics>

<system.net>

<defaultProxy>

<proxy usesystemdefault=”False” bypassonlocal=”True” proxyaddress=”http://127.0.0.1:8888“/>

</defaultProxy>

</system.net>

http://mkdot.net/blogs/dejan/archive/2008/10/23/wcf-tracing-and-message-logging.aspx

And to get message details logged as well then need an additional node.

<configuration> <system.serviceModel> <diagnostics> <messageLogging logEntireMessage=”true” logMalformedMessages=”true” logMessagesAtServiceLevel=”true” logMessagesAtTransportLevel=”true” maxMessagesToLog =”1000″ maxSizeOfMessageToLog=”524288″/> </diagnostics>

http://stevenhollidge.blogspot.com/2011/03/how-to-enable-tracing-for-wcf-service.html

Generate the required WPF trace entries in web.config by using Visual Studio project.

<system.diagnostics> <sources> <source name=”System.Net” tracemode=”includehex” maxdatasize=”1024″> <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> <source name=”System.ServiceModel.MessageLogging” switchValue=”Warning, ActivityTracing”> <listeners> <add type=”System.Diagnostics.DefaultTraceListener” name=”Default”> <filter type=”” /> </add> <add name=”ServiceModelMessageLoggingListener”> <filter type=”” /> </add> </listeners> </source> <source name=”System.ServiceModel” switchValue=”Warning,ActivityTracing”> <listeners> <add name=”ServiceModelTraceListener”/> </listeners> </source> <source name=”System.Runtime.Serialization” switchValue=”Warning,ActivityTracing”> <listeners> <add name=”ServiceModelTraceListener”/> </listeners> </source> </sources> <switches> <add name=”System.Net” value=”Verbose”/> <add name=”System.Net.Sockets” value=”Verbose”/> <add name=”System.Net.Cache” value=”Verbose”/> </switches> <sharedListeners> <add name=”System.Net” type=”System.Diagnostics.TextWriterTraceListener” initializeData=”C:\temp\network.log”/> <add initializeData=”C:\temp\searchservice.svclog” type=”System.Diagnostics.XmlWriterTraceListener” name=”ServiceModelTraceListener” traceOutputOptions=”Timestamp”/> <add initializeData=”c:\temp\app_messages.svclog” type=”System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ name=”ServiceModelMessageLoggingListener” traceOutputOptions=”Timestamp”/> </sharedListeners> <trace autoflush=”true”/> </system.diagnostics>   <system.net>     <defaultProxy>       <proxy               usesystemdefault=”False”               bypassonlocal=”True”               proxyaddress=”http://127.0.0.1:8888″/>     </defaultProxy>   </system.net> </configuration>

http://msdn.microsoft.com/en-us/library/aa751795.aspx

Walk through of WCF tracing. With screenshots. To explain the output.

http://msdn.microsoft.com/en-us/library/ms751526.aspx

Tracing web.config entries.

About these ads
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 63 other followers