Monitor and troubleshoot Microsoft Dynamics CRM
Applies To: Dynamics CRM 2015
In Microsoft Dynamics CRM, you can create trace files that monitor the actions that are performed by the server and client applications. Trace files are helpful when you have to troubleshoot error messages or other issues in Microsoft Dynamics CRM.
To enable Microsoft Dynamics CRM Server tracing, you can use deployment-level tracing or server-level tracing. Choosing either method determines the range of server roles monitored, the degree of control, and how to enable tracing and the location of the trace files.
Additionally, Microsoft Dynamics CRM Reporting Extensions, Dynamics CRM for Outlook, and Microsoft Dynamics CRM for tablets can be enabled for tracing.
In This Topic
Microsoft Dynamics CRM deployment-level tracing
Microsoft Dynamics CRM server-level tracing
Enable tracing for Microsoft Dynamics CRM Reporting Extensions for SQL Server Reporting Services
Enable tracing for Microsoft Dynamics CRM for Outlook
Enable tracing for Microsoft Dynamics CRM Email Router
Enable tracing for CRM for phones for Windows Phone
Enable tracing for CRM for tablets
System Center Operations Manager management pack for Microsoft Dynamics CRM 2015
Microsoft Dynamics CRM deployment-level tracing
Deployment-level tracing monitors all Microsoft Dynamics CRM server roles and services, regardless of the server roles installed on the local computer. When deployment-level tracing is enabled, all server roles are monitored such as Asynchronous Service, Sandbox Processing Service, Unzip Service, Web application (w3wp), and Deployment Tools (mmc-Tools). Corresponding trace files are created.
Deployment-level tracing is set by using Windows PowerShell commands and is maintained in the MSCRM_CONFIG database. Deployment-level tracing can only be enabled from a computer that has the Microsoft Dynamics CRM Deployment Tools server role.
The trace files are located in a folder on the computer where the Microsoft Dynamics CRM Deployment Tools server role is running. By default, the location is C:\crmdrop\logs.
Warning
Trace files may contain sensitive or personal information. Use discretion when you send trace files to other people, or when you give other people the ability to view the information in a trace file.
When you turn on tracing it can significantly affect performance of the application. We strongly recommend that you only turn on tracing for troubleshooting issues and turn off tracing after the issue is resolved.
Important
Before you run Microsoft Dynamics CRM Windows PowerShell commands, the Microsoft.Crm.PowerShell snap-in must be registered by running the Add-PSSnapin Microsoft.Crm.PowerShell command.
For more information, see Administer the deployment using Windows PowerShell.
Tip
To get a list of the registered Windows PowerShell snap-ins, run the Get-PsSnapin –registered command.
View the current deployment-wide trace settings
Get-CrmSetting TraceSettings
Enable deployment-wide tracing
To turn on deployment-wide trace settings that record the maximum amount of information, including detailed logging with callstack information, run the following commands, in the order provided, from the Windows PowerShell console on the computer where the Deployment Tools server role is running. To enable less detailed logging or to change the location of the log files, see Optional parameters.
$Setting = Get-CrmSetting TraceSettings$Setting.Enabled = $True $Setting.CallStack=$True$Setting.Categories="*:Verbose"Set-CrmSetting $setting
Optional parameters
CallStack. Records callstack information. For detailed troubleshooting, we recommend that you turn this on. By default, this is turned off.
Categories. Indicates the level of detail to record.
Error. By default, the Categories value is Error, which is the least detailed and only records errors.
Warning. Includes warnings and errors.
Info. Includes warnings, errors, and additional information.
Verbose. Records the most detailed information.
Directory. Specifies the location of the trace log file. By default, the location is c:\crmdrop\logs.
FileSize. Specifies the maximum file size of the log file in megabytes before information in the trace file is overwritten.
Disable deployment-level tracing
To disable tracing, run the following commands, in the order provided, from the Windows PowerShell console on the computer where the Deployment Tools server role is running.
$Setting = Get-CrmSetting TraceSettings$setting.Enabled = $FalseSet-CrmSetting $setting
Trace files aren’t deleted when tracing is disabled. Additionally, services used by Microsoft Dynamics CRM Server lock open the trace files. Therefore, you may have to restart any Microsoft Dynamics CRM services and the World Wide Web Publishing Service if these services are running on the computer where you want to delete the trace files.
Microsoft Dynamics CRM server-level tracing
Server-level tracing only monitors those Microsoft Dynamics CRM server roles that are running on the local computer where server-level tracing is enabled. When server-level tracing is enabled, trace files that are specific to the Microsoft Dynamics CRM server roles or services that are running on the local computer are created. Server-level tracing does not require the Deployment Tools role and can provide a greater degree of control where you can set specific trace values such as what Microsoft Dynamics CRM features to trace or the maximum trace file size.
For more information about setting server-level tracing properties in Microsoft Dynamics CRM, see How to enable tracing in Microsoft Dynamics CRM.
If both deployment-level and server-level tracing are enabled on the same computer, only server-level tracing will be used.
Server-level tracing must be manually set in the Windows registry on the computer where one or more Microsoft Dynamics CRM server roles are running.
The server-level tracing files are located in the Traces folder of the Microsoft Dynamics CRM installation folder. By default, the location is C:\Program Files\Microsoft Dynamics CRM\Trace.
Enable or disable server-level tracing
Warning
Trace files may contain sensitive or personal information. Use discretion when you send trace files to other people, or when you give other people the ability to view the information that a trace file contains.
When you turn on tracing it can significantly affect performance of the application. We strongly recommend that you only turn on tracing for troubleshooting issues and turn off tracing after the issue is resolved.
Warning
This task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see: How to back up and restore the registry in Windows.
On the Microsoft Dynamics CRM Server that you want to turn on server-level tracing, start RegEdit and locate the following registry location: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\MSCRM
Create the following two required new values.
Value name |
Type |
Value |
---|---|---|
TraceEnabled |
DWORD (32-bit) |
0 or 1 If you use a value of 0, tracing is disabled. If you use a value of 1, tracing is enabled. |
TraceRefresh |
DWORD (32-bit) |
A number between zero and 99 This value must change for Microsoft Dynamics CRM to detect a change to any of the other trace values in the Windows registry. For example, if the value is 2, you can set it to 1 so that other trace values changes, such as a change to TraceCategories, will be applied. |
Enable tracing for Microsoft Dynamics CRM Reporting Extensions for SQL Server Reporting Services
In Microsoft Dynamics CRM, you can create trace files that monitor the actions that are performed by Microsoft Dynamics CRM Reporting Extensions. Trace files are helpful when you have to troubleshoot error messages or other issues in Microsoft Dynamics CRM Reporting Extensions.
Warning
Trace files may contain sensitive or personal information. Use discretion when you send trace files to other people, or when you give others the ability to view the information that a trace file contains.
When you turn on tracing it can significantly affect performance of the application. We strongly recommend that you only turn on tracing for troubleshooting issues and turn off tracing after the issue is resolved.
You can enable tracing for Microsoft Dynamics CRM Reporting Extensions in two ways:
Enable tracing using registry values
Enable tracing using deployment properties
Important
Traces will not be generated if the folder specified in TraceDirectory does not exist.
Enable tracing using registry values
Warning
This task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see: How to back up and restore the registry in Windows.
On the computer where you have installed Microsoft Dynamics CRM Reporting Extensions, locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\MSCRM
Set the following registry values:
TraceEnabled = 1
TraceDirectory = <directory path where traces will be stored>
You can also set other row values like TraceCategories, but they already have defaults.
Restart Microsoft SQL Server Reporting Services.
Enable tracing using deployment properties
Go to the DeploymentProperties table in the Configuration Database.
Locate the row with the value "TraceEnabled" and set its "BitColumn" column’s value to "True".
Other row values like TraceCategories, TraceDirectory already have default values, but you can change these values.
You’ll start seeing the traces in the directory specified in the TraceDirectory row in the DeploymentProperties table.
Restart Microsoft SQL Server Reporting Services.
Registry settings take precedence over deployment properties. If there are any invalid entries in the registry, for example, and TraceDirectory does not exist, the deployment properties are used.
Enable tracing for Microsoft Dynamics CRM for Outlook
This section applies to Microsoft Dynamics CRM Online and on-premises versions of Microsoft Dynamics CRM. Dynamics CRM for Outlook tracing monitors the instance of Dynamics CRM for Outlook that is running on the local computer. If an issue is isolated to a particular user running Dynamics CRM for Outlook, enabling Dynamics CRM for Outlook tracing can help determine the cause.
The Dynamics CRM for Outlook tracing files are located in the C:\Users\<username>\AppData\Local\Microsoft\MSCRM\Traces folder.
Warning
Trace files may contain sensitive or personal information. Use discretion when you send trace files to other people, or when you give other people the ability to view the information that a trace file contains.
When you turn on tracing it can significantly affect performance of the application. We strongly recommend that you only turn on tracing for troubleshooting issues and turn off tracing after the issue is resolved.
Enable or disable tracing for Microsoft Dynamics CRM for Outlook
On the computer running Dynamics CRM for Outlook, click Start, click All Programs, click Microsoft Dynamics CRM 2015, and then click Diagnostics.
Click the Advanced Troubleshooting tab, and then select Tracing to enable or click to clear Tracing to disable.
Select a Tracking level from the drop-down list.
Click Save.
You can reduce the amount of information during the trace by setting the TraceCategories Windows registry value. For example, you can set the value so that only error messages are recorded. Reducing the amount of logging can be helpful when you troubleshoot specific issues, such as when you receive error messages going offline. To do this, follow these steps.
Warning
Turning on verbose tracing during process intense actions such as Outlook startup, or going online and offline with Dynamics CRM for Outlook, is not recommended and could result in stability issues with Dynamics CRM for Outlook.
This task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, see How to back up and restore the registry in Windows.
Notice that tracing must already be enabled for the following steps to work.
On the computer where you have installed Dynamics CRM for Outlook start RegEdit and locate and then click the following registry subkey: HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient.
If the TraceCategories string value does not exist add it. To do this, right-click MSCRMClient, click New, click String Value, type TraceCategories and then press ENTER.
Right-click TraceCategories, click Modify, type Application.Outlook:Error, and then click OK.
For more information about the values available for TraceCategories, see How to enable tracing in Microsoft Dynamics CRM.
Trace files are not deleted when tracing is disabled.
Enable tracing for Microsoft Dynamics CRM Email Router
This section applies to Microsoft Dynamics CRM Online and on-premises versions of Microsoft Dynamics CRM. Microsoft Dynamics CRM 2015 Email Router tracing monitors the Email Router service that is running on the local computer.
Enable or disable tracing for Microsoft Dynamics CRM Email Router
On the computer where the Microsoft Dynamics CRM Email Router service (Microsoft CRM Email Router) is running, open Microsoft.Crm.Tools.EmailAgent.xml using an XML or text editor. By default, Microsoft.Crm.Tools.EmailAgent.xml is located in the <drive>:\Program Files\Microsoft CRM Email\Service folder.
Add the following entries between the <SystemConfiguration> parent elements:
<LogLevel>Level</LogLevel>
Specifies the logging level. Acceptable values for Level are 0, 1, 2, or 3.0. No logging. By default, logging is set to 0.
1. Error logging only.
2. Detailed information logging at the mailbox level.
3. Very detailed information logging at the message level.
<LogFile>Path\Logfilename</LogFile>
Specifies the full path of the location to the log file.
Restart the Email Router service.
Sample Microsoft.Crm.Tools.EmailAgent.xml
The following Microsoft.Crm.Tools.EmailAgent.xml file sets the logging at level 1 and places the log file at c:\emailRouterLog.txt.
<?xml version="1.0" encoding="utf-8"?>
<Configuration>
<SystemConfiguration>
<MaxThreads>50</MaxThreads>
<MaxThreadExecution>600000</MaxThreadExecution>
<SchedulingPeriod>1000</SchedulingPeriod>
<ConfigRefreshPeriod>5000</ConfigRefreshPeriod>
<ConfigUpdatePeriod>3600000</ConfigUpdatePeriod>
<LogLevel>1</LogLevel>
<LogFile>c:\emailRouterLog.txt</LogFile>
<ProviderOverrides>
<CacheCapacity>1024</CacheCapacity>
<PendingStatusDelay>300000</PendingStatusDelay>
<SendingStatusDelay>1800000</SendingStatusDelay>
<MaximumDeliveryAttempts>10</MaximumDeliveryAttempts>
<EWSRetrieveMessageCount>10</EWSRetrieveMessageCount>
<BatchSize>5</BatchSize>
<RequestBatchSize>5</RequestBatchSize>
</ProviderOverrides>
</SystemConfiguration>
</Configuration>
Enable tracing for CRM for phones for Windows Phone
To help with troubleshooting, follow these steps to capture and view logs on your Windows Phone.
Install the Field Medic app
Install the Field Medic app from the Windows Phone store.
Create a custom profile for AppHost logging
Connect your Windows Phone to your computer via USB.
Create the file FieldMedic-AppHost.xml in the following folder: computer\<windows phone>\Phone\Documents\FieldMedic. Create the folder structure if it doesn’t exist already. You can create the file using Notepad and save as FieldMedic-AppHost.xml.
Using Notepad, add the following code to the FieldMedic-AppHost.xml file.
<?xml version="1.0" encoding="utf-8" standalone='yes'?> <WindowsPerformanceRecorder Version="1.0" Author="CXE Ecosystem SATT" Team="CXE Ecosystem SATT" Comments="FieldMedic ETW profiles" Company="Microsoft Corporation" Copyright="Microsoft Corporation" Tag="FieldMedic"> <Profiles> <!-- Event Collectors --> <EventCollector Id="EventCollector_AppHost" Name="FieldMedic AppHost Category Event Collector" Private="false" ProcessPrivate="false" Secure="false" Realtime="false"> <BufferSize Value="128"/> <Buffers Value="40"/> <MaximumFileSize Value="5" FileMode="Circular"/> <FileMax Value="3"/> </EventCollector> <!-- Event Providers --> <EventProvider Id="EventProvider_Microsoft-Windows-AppHost" Name="98e0765d-8c42-44a3-a57b-760d7f93225a" Level="5"/> <!-- Profiles --> <Profile Id="AppHost.Verbose.File" LoggingMode="File" Name="AppHost" DetailLevel="Verbose" Description="FieldMedic AppHost category profile"> <Collectors> <EventCollectorId Value="EventCollector_AppHost"> <EventProviders> <EventProviderId Value="EventProvider_Microsoft-Windows-AppHost"/> </EventProviders> </EventCollectorId> </Collectors> </Profile> </Profiles> </WindowsPerformanceRecorder>
Enable logging
Open the Field Medic app.
Tap Advanced.
Tap Choose which ETW providers to use.
Swipe up to locate the Custom Group section and then select the checkbox for FieldMedic-AppHost.xml.
Tap the back button twice.
Tap Start Logging.
The following will appear.
>
Reproduce your issue
Switch to the CRM for phones app.
Reproduce your issue.
Stop logging
Switch to the Field Medic app.
Tap Stop Logging.
Provide a title for the logs and then tap Save.
Tap View Reports to confirm you logs were successfully saved.
>
Locate the log files
Disconnect and reconnect the USB cable to your Windows Phone. This will ensure the latest files appear.
On your computer, navigate to: computer\<windows phone>\Phone\Documents\FieldMedic\reports
Copy the contents of this folder to your computer.
View logs using Event Viewer
Open Event Viewer on your computer.
Choose Action > Open Saved Log…
Navigate to: computer\<windows phone>\Phone\Documents\FieldMedic\reports or wherever you copied the log files from your Windows Phone.
Select and open the Custom-FieldMedic-AppHost file.
If prompted to open the log in the new event log format, choose Yes, and then choose OK.
Review the event log entries for any errors.
Enable tracing for CRM for tablets
You can enable tracing in the Microsoft Dynamics CRM for tablets app to diagnose issues. When you enable tracing, verbose information is recorded on the device. This information can be analyzed to help identify the source of an issue. The way to enable and view tracing differs depending on the tablet operating system.
Windows
Follow these steps to view events. Tracing is enabled by default.
Open the Event Viewer. To do this, go to the Start screen, type Run, and then press or tap ENTER. In the Run box type eventvwr, and then press or tap ENTER.
Select the AppHost folder under Application And Services Logs\Microsoft\Windows
From the View menu, click or tap Show Analytic and Debug Logs.
Additional nodes will appear under the AppHost folder.
Right-click (press and hold) the AppTracing node and then click or tap Enable Log.
Click or tap OK to agree to the following warning.
After reproducing the issue, right-click (press and hold) AppTracing and then click or tap Disable Log.
Refresh the Event Viewer to view log events. You can use F5 or right-click (press and hold) AppTracing and then click or tap Refresh.
Review the details of events that are logged. Look for entries containing “Dynamics CRM” in the field under the General tab.
Tip
You can right-click (press and hold) AppTracing and then click or tap Find to initiate a find. Then search for any events containing a word such as “CRM.” Ctrl + F is the keyboard shortcut.
Also check the events logged under Admin.
To save an event log, right-click (press and hold) the log and select Save All Events As. Specify the directory where you want to save the log file.
iPad
Follow these steps to set up and view logging on the iPad.
Enable logging on the iPad
Open Settings.
Select Dynamics CRM from the Settings list.
The Enable Logging option is set to OFF by default. Toggle this option to switch the setting to ON.
After reproducing the issue, toggle the Enable Logging setting to OFF.
View the iPad log files
Connect your iPad to your computer.
Open iTunes.
Select your device from the Devices section.
Select the Apps area from the header.
Locate the File Sharing section and select the Dynamics CRM app.
On the right-side column you should see a list of log files if logging was enabled for the app. Select a log file, press Save to, and then choose a location to save the log file.
Locate the log file you saved and open it to view the log details.
Android
On an Android device, you can enable logging during or after configuration.
If you’re setting up CRM for tablets, see Enable logging on the setup page.
If you have already configured CRM for tablets and encounter an error post configuration, you need to sign out or reconfigure to enable logging. See Enable logging after configuration.
Note
By default, logging is disabled. If you enable logging and close and reopen CRM, logging will be disabled,
Enable logging on the setup page
On the setup page for CRM for tablets, tap the ellipses (…) to display the option to enable logging.
Tap the Enable Logging checkbox.
Enable logging after configuration
Open the CRM for Android app.
While on the dashboard, tap the ellipses (…) in the bottom-right corner to display the command bar.
Tap Settings, and then tap Sign out.
On the sign-in page, tap the back button to go to the set up page.
On the setup page for CRM for tablets, tap the ellipses (…) to display the option to enable logging.
Tap the Enable Logging check box.
View the Android log files
Logging is written to a log file in the MSCRM folder in the root directory of your device. You can connect your tablet to your computer with USB to browse the file system. You can also use other company’s Android apps to view the file system.
Open the MSCRM folder, then select and view the log file.
Sample log
The following example shows you what you might see in a log file.
2013-08-20 15:33:23 +0000 [INFO]: Unique install id | 5FDD3711-9E89-4D8B-B835-88B2C7C51703 2013-08-20 15:33:23 +0000 [INFO]: Application activated 2013-08-20 15:33:24 +0000 [INFO]: Application resume 2013-08-20 15:33:25 +0000 [ERROR]: App WebView Load failed | -1003 2013-08-20 15:33:32 +0000 [INFO]: [PAL] | Authentication: Starting 2013-08-20 15:33:32 +0000 [INFO]: [PAL] | Authentication: Starting authorization 2013-08-20 15:33:32 +0000 [INFO]: [PAL] | Authentication: Authorization error: -2147093999 2013-08-20 15:33:39 +0000 [INFO]: [PAL] | Authentication: Starting 2013-08-20 15:33:39 +0000 [INFO]: [PAL] | Authentication: Starting authorization 2013-08-20 15:33:39 +0000 [INFO]: [PAL] | Authentication: Authorization error: -2147093999 2013-08-20 15:33:42 +0000 [INFO]: Application Pause 2013-08-20 15:34:27 +0000 [INFO]: Unique install id | 5FDD3711-9E89-4D8B-B835-88B2C7C51703 2013-08-20 15:34:27 +0000 [INFO]: Application activated 2013-08-20 15:34:27 +0000 [INFO]: Application resume 2013-08-20 15:34:27 +0000 [INFO]: [PAL] | Authentication: Failed - cookie setup 2013-08-20 15:34:28 +0000 [INFO]: [PAL] | Authentication: Complete 2013-08-20 15:34:30 +0000 [INFO]: [PAL] | Authentication: Starting 2013-08-20 15:34:30 +0000 [INFO]: [PAL] | Authentication: Starting authorization 2013-08-20 15:34:30 +0000 [INFO]: [PAL] | Authentication: Authorization complete 2013-08-20 15:34:30 +0000 [INFO]: [PAL] | Authentication: Complete 2013-08-20 15:34:31 +0000 [INFO]: [PAL] | Error Messages: 1: Principal user (Id=d0961fb9-0f09-e311-b8aa-00155d05381a, type=8) is missing prvReadAccount privilege (Id=886b280c-6396-4d56-a0a3-2c1b0a50ceb0)2: Principal user (Id=d0961fb9-0f09-e311-b8aa-00155d05381a, type=8) is missing prvReadAccount privilege (Id=886b280c-6396-4d56-a0a3-2c1b0a50ceb0)2013-08-20 15:36:30 +0000 [INFO]: Application Pause
System Center Operations Manager management pack for Microsoft Dynamics CRM 2015
The Operations Manager management pack for CRM enables you to monitor Microsoft Dynamics CRM Server 2015 and Microsoft Dynamics CRM Server 2013 in Microsoft System Center Operations Manager.
You can download the Microsoft System Center Operations Manager management pack for Microsoft Dynamics CRM 2015 here.
See Also
Operating Microsoft Dynamics CRM 2015
Microsoft Dynamics CRM data protection and recovery
© 2016 Microsoft Corporation. All rights reserved. Copyright