Saturday, November 1, 2008

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

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\

Microsoft.ResourceManagement.Service.exe.config

In the <configuration> after </configsections> and before <appsettings> add the following:

<!-- Enable Tracing -->
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="Microsoft.ResourceManagement" switchValue="All">
<listeners>
<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"/>
</listeners>
</source>
</sources>
</system.diagnostics>
<!-- End Enable Tracing -->



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.

1 comment:

Brad Turner said...

Thanks David, for those of you looking for the right SDK, you're likely going to want the most recent version for Server 2008 and .NET 3.5 which can be found here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en