:: thoughts on team system and more RSS 2.0
# Tuesday, August 09, 2005

This is the first part in a series of small exercises where I try out the diagnostics features in WCF (Indigo). The articles will cover the Logging, Tracing, Performance Counters and WMI features in WCF.

 

First out is logging. Logging is controlled by using the configuration file for the application. By default all logging is turned off but it can be enabled individually for transport level-, service level- and malformed messages.

 

The following is an example that enables all message logging:

 

<diagnostics>

      <messageLogging

            filterTransportMessages="false"

            logEntireMessage="true"

            logMessagesAtTransportLevel="true"

            logMessagesAtServiceLevel="true"

            logMalformedMessages="true"

            maxMessagesToLog="100"

            maxNumberOfFilters="20"

            maxSizeOfMessageToLog="1000000"

      />

</diagnostics>

 

The highlighted attributes are the key attributes to enable the logging feature. logEntireMessage is set to true in order to have the whole message logged. The default is to only log the message header. The next three entries enable logging at the various levels. Depending on the binding used (and its configuration) there may be quite a few messages logged for each invoked operation. Since WCE logs all messages processed that may include messages things such as policy and security negotiation. It would be interesting to see complete flows of what is happening during the client-server interactions, but that is a different story...

 

The log files written are named like this:

 

   PID(AppDomainName)_Ticks_MsgIndex.xml

 

By default log files are written using a default trace listener, which will write the files at the following location:

 

   %windir%\system32\Logfiles\Messages

 

If another location should be used then a trace listener must be added in the "system.diagnostics" section in the configuration file for the source name “IndigoMessageLogTraceSource”.

 

The configuration below will write log files to a specified point using the provided MessageWriterTraceListener class:

 

<system.diagnostics>

   <sources>

      <source name="IndigoMessageLogTraceSource"

                   switchValue="Verbose">

         <listeners>

            <add name="multifile" type="System.ServiceModel.Diagnostics.MessageWriterTraceListener, System.ServiceModel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

                     initializeData="c:\logs\messages" 

                     maxDiskSpace="1000" />

         </listeners>

      </source>

   </sources>

</system.diagnostics>

 

The highlighted attribute sets the directory used for the message logging, in this case c:\logs\messages.

 

Unfortunately it seems like it is only possible to set the diagnostics configuration before the service is started. If the configuration is changed while the application is running it has no impact. This is of course a limitation that is going to be hard to deal with in a production environment. Hopefully there will be some more work done in this area before the v.1 release of WCF comes out the door.

Tuesday, August 09, 2005 10:12:11 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [1] -
WCF (Indigo)
Navigation
Archive
<August 2005>
SunMonTueWedThuFriSat
31123456
78910111213
14151617181920
21222324252627
28293031123
45678910
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Mathias Olausson
Sign In
Statistics
Total Posts: 74
This Year: 22
This Month: 6
This Week: 2
Comments: 29
Themes
Pick a theme:
All Content © 2008, Mathias Olausson
DasBlog theme 'Business' created by Christoph De Baene (delarou)