FIM Service Troubleshooting: How to Enable Tracing
Overview
This document will provide the steps necessary to work enable FIM Service Tracing. FIM Service Tracing is enabled/disabled via the FIM Service Configuration File ( %programfiles%\Microsoft Forefront Identity Manager\2010\Service\Microsoft.ResourceManagement.Service.Exe.Config ).
Steps to enable FIM tracing
- Prior to making any changes to this file, it is very important to make a backup copy of this file. You can do this by very simply copying, and pasting the file in the same directory, or placed into a backup directory.
- Once you have made the backup copy of the FIM Service Configuration File, then let's edit the FIM Service Configuration File.
- *NOTE* You can use editors such as Notepad, Visual Studio, or any text file editor.
- Set the log file location
- In this wiki, we will be using "C:\Logs" as the place to put our log files. By default, "C:\Logs does not exist. If you do not have a "C:\Logs" folder, then please create one at this time.
- The FIM Service Account must have access to the folder that you are placing the trace files.
- In this wiki, we will be using "C:\Logs" as the place to put our log files. By default, "C:\Logs does not exist. If you do not have a "C:\Logs" folder, then please create one at this time.
- Insert the messageLogging section
While editing the FIM Service Configuration File, go to the top and search for the word system.serviceModel.
You should end up at the XML tag <system.serviceModel>
You will want to insert some spaces between the XML tag <system.serviceModel> and the tag <services>
Paste the below text in between the XML tag <system.serviceModel> and the tag <services> 1.
``` <diagnostics> <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxSizeOfMessageToLog="2147483647"/> </diagnostics> ```
Once copied, it should look like the below:
-
<system.serviceModel> <diagnostics> <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" maxSizeOfMessageToLog="2147483647"/> </diagnostics> <services>
- Update the <system.diagnostics> section
While editing the FIM Service Configuration File, go to the top and search for the word system.diagnostics.
You should end up at the XML tag <system.diagnostics>
If you have a default FIM Service Configuration File, then you will see the <sources> tag directly under the <system.diagnostics> tag
In between the <system.diagnostics> tag and the <sources> tag, paste the below section for the <switches> tag
** **
<switches> <add name="System.Workflow LogToTraceListeners" value="1" /> <add name="System.Workflow.Runtime.Hosting" value="Verbose" /> <add name="System.Workflow.Runtime" value="Verbose" /> <add name="System.Workflow.Runtime.Tracking" value="Verbose" /> <add name="System.Workflow.Activities" value="Verbose" /> <add name="System.Workflow.Activities.Rules" value="Verbose" /> </switches>
Once copied, it should look like:
<
system.diagnostics> <switches> <add name="System.Workflow LogToTraceListeners" value="1" /> <add name="System.Workflow.Runtime.Hosting" value="Verbose" /> <add name="System.Workflow.Runtime" value="Verbose" /> <add name="System.Workflow.Runtime.Tracking" value="Verbose" /> <add name="System.Workflow.Activities" value="Verbose" /> <add name="System.Workflow.Activities.Rules" value="Verbose" /> </switches> <sources>
Now let's talk about the sources
- SOURCE: "Microsoft.ResourceManagement"
- Change the switchvalue from Error to "Verbose,ActivityTracing"
- It should look like: <source name="Microsoft.ResourceManagement" switchValue="Verbose,ActivityTracing">
- In this Source Tag, look for "DiagnosticListener" (e.g. <add name="DiagnosticListener">)
- Change DiagnosticListener to ServiceModelTraceListener
- It should look like: <add name="ServiceModelTraceListener">
- Change the switchvalue from Error to "Verbose,ActivityTracing"
- Now we need to add a few more sources. Look for the </source> which closes the Microsoft.ResourceManagement <source> tag
- Copy the below section and place it after the </source> tag and before the </sources> tag
<source name="System.ServiceModel" switchValue="Verbose,ActivityTracing" propagateActivity="true"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelTraceListener"> <filter type="" /> </add> </listeners> </source> <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelMessageLoggingListener"> <filter type="" /> </add> </listeners> </source>
It should look like this once copied:
-
</source> <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing" propagateActivity="true"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelTraceListener"> <filter type="" /> </add> </listeners> </source> <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing"> <listeners> <add type="System.Diagnostics.DefaultTraceListener" name="Default"> <filter type="" /> </add> <add name="ServiceModelMessageLoggingListener"> <filter type="" /> </add> </listeners> </source> </sources>
- Now, let's talk about the <sharedListeners> tag. We are going to replace the <sharedListeners> tag.
In the FIM Configuration File, search for the <sharedListeners> tag, and then the </sharedListeners> tag.
Highlight the entire section from <sharedListeners> to </sharedListeners>
Paste the below text to relace the default <sharedListeners> section
** <sharedListeners>**
<add initializeData="C:\Logs\Microsoft.ResourceManagement.Service_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
<filter type="" />
</add>
<add initializeData="C:\Logs\Microsoft.ResourceManagement.Service_messages.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelMessageLoggingListener" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack">
<filter type="" />
</add>
<add initializeData="c:\logs\fimservice_textOutput.txt" type="System.Diagnostics.TextWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="Text" traceOutputOptions="DateTime, ThreadId">
<filter type="" />
</add>
** </sharedListeners>**
- Just below the </sharedListeners> tag is a commented section for <trace autoflush.
- Replace <!--<trace autoflush="true"/>--> with <trace autoflush="true" />
- SOURCE: "Microsoft.ResourceManagement"
- Save the file
Disable tracing
If you made the backup copy of the FIM Service Configuration File, then you can rename the tracing file to Microsoft.ResourceManagement.Service.Exe.Config._TracingEnabled. Once you do that, then rename the backup copy back to Microsoft.ResourceManagement.Service.Exe.Config. If you do this, then you should be able to easily toggle back forth to enable/disable tracing.
Anytime you change the FIM Service Configuration File, then you will need to restart the FIM Service (Forefront Identity Manager Service).
Additional FIM tracing articles
- How to configure FIM Portal Tracing
- Enable Tracing and Viewing Trace Logs
- How to enable FIM Service Management Agent Tracing
- How to enable verbose tracing for the FIM Portal