Under the hood of ILM 2 -- Part 1 Enable WCF Tracing!

November 1, 2008

Want to understand what is happening with your custom ILM 2 workflow? or your calls to the web service?

Try enabling WCF Tracing. By enabling WCF tracing for the Identity Lifecycle Manager Resource Management Service you get to track requests to the webservice. This can help you figure out if your requests are even getting to the webservice.

To enable tracing open the config file:

C:\Program Files\Microsoft Identity Management\Common Services\


In the after and before add the following:

<!-- Enable Tracing -->  
    <trace autoflush\="true" />  
      <source name\="Microsoft.ResourceManagement" switchValue\="All"\>  
          <add name\="text" type\="System.Diagnostics.TextWriterTraceListener" initializeData\="c:\\logs\\service.txt" traceOutputOptions\="Timestamp,ThreadId,DateTime"/>  
          <add name\="xml" type\="System.Diagnostics.XmlWriterTraceListener" initializeData\="c:\\logs\\service.svclog" traceOutputOptions\="Timestamp,ThreadId,DateTime"/>  
  <!-- End Enable Tracing -->

.csharpcode, .csharpcode pre{ font-size: small; color: black; font-family: consolas, “Courier New”, courier, monospace; background-color: #ffffff; /*white-space: pre;*/}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em;}.csharpcode .lnum { color: #606060; }

Then you need to create a directory called c:\ILMLogs and restart the ILM Common Services. If you don’t create the directory then the logging still won’t work, and you’ll have to restart the service.

To view the log you need to have installed the Windows SDK and then you use the Service Trace Viewer

C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\SvcTraceViewer.exe

For more info on how to read and interpret the trace see Part 2.

For more info on writing your own traces from your own code see Craig Martin’s post on WCF tracing.