Monitor and troubleshoot Microsoft Dynamics CRM

 

Applies To: Dynamics CRM 2013

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.

There are two methods to enable Microsoft Dynamics CRM Server tracing: 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, 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 E-mail Router

Enable tracing for CRM for tablets

System Center Monitoring Pack for Microsoft Dynamics CRM 2013

Microsoft Dynamics CRM 2013 performance counters

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 records the maximum amount of information that includes 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 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 are not 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 2013, 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 in order 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 2013, 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.

  1. 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

  2. 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.

  3. Restart Microsoft SQL Server Reporting Services.

Enable tracing using deployment properties

  1. Go to the DeploymentProperties table in the Configuration Database.

  2. 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 will start seeing the traces in the directory specified in the TraceDirectory row in the DeploymentProperties table.

  3. 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 2013. CRM for Outlook tracing monitors the instance of CRM for Outlook that is running on the local computer. If an issue is isolated to a particular user running CRM for Outlook, enabling CRM for Outlook tracing can help determine the cause.

The 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

  1. On the computer running CRM for Outlook, click Start, click All Programs, click Microsoft Dynamics CRM 2013, and then click Diagnostics.

  2. Click the Advanced Troubleshooting tab, and then select Tracing to enable or click to clear Tracing to disable.

  3. Click Save.

The above steps turn on verbose tracing in Microsoft Dynamics CRM 2013 and error tracing in CRM 2013 SP1. 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 CRM for Outlook, is not recommended and could result in stability issues with 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, click the following article number to view the article in the Microsoft Knowledge Base: How to back up and restore the registry in Windows.

Notice that tracing must already be enabled for the following steps to work.

  1. On the computer where you have installed CRM for Outlook start RegEdit and locate and then click the following registry subkey: HKEY_CURRENT_USER\Software\Microsoft\MSCRMClient.

  2. 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.

  3. 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 E-mail Router

This section applies to Microsoft Dynamics CRM Online and on-premises versions of Microsoft Dynamics CRM 2013. Microsoft Dynamics CRM 2013 Email Router tracing monitors the Email Router service that is running on the local computer.

Enable or disable tracing for Microsoft Dynamics CRM E-mail Router

  1. 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.

  2. 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.

  3. 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 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 8

Follow these steps to view events. Tracing is enabled by default.

  1. 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.

  2. Select the AppHost folder under Application And Services Logs\Microsoft\Windows

  3. From the View menu, click or tap Show Analytic and Debug Logs.

    Show Analytic and Debug Logs

  4. Additional nodes will appear under the AppHost folder.

    AppHost Folder

  5. Right-click (press and hold) the AppTracing node and then click or tap Enable Log.

    AppTracing Enable Log

  6. Click or tap OK to agree to the following warning.

    Warning: logs may lose events

  7. After reproducing the issue, right-click (press and hold) AppTracing and then click or tap Disable Log.

    AppTracing Disable Log

  8. 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.

    Refresh AppTracing

  9. Review the details of events that are logged. Look for entries containing “Dynamics CRM” in the field under the General tab.

    AppTracing Find

    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.

  10. 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.

    Events logged under admin

iPad

Follow these steps to set up and view logging on the iPad.

Enable logging on the iPad

  1. Open Settings.

    iPad Settings

  2. Select Dynamics CRM from the Settings list.

    iPad Settings Dynamics CRM

  3. The Enable Logging option is set to OFF by default. Toggle this option to switch the setting to ON.

    iPad Enable Logging on

  4. After reproducing the issue, toggle the Enable Logging setting to OFF.

    iPad Settings Dynamics CRM

View the iPad log files

  1. Connect your iPad to your computer.

  2. Open iTunes.

  3. Select your device from the Devices section.

    iTunes Devices

  4. Select the Apps area from the header.

    iTunes Apps

  5. Locate the File Sharing section and select the Dynamics CRM app.

    iTunes File Sharing

    iTunes File Sharing Dynamics CRM

  6. 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.

    iTunes Save Dynamics CRM log file

  7. 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 are 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

  1. On the setup page for CRM for tablets, tap the ellipses (…) to display the option to enable logging.

    Enable logging for Android

     

  2. Tap the Enable Logging checkbox.

Enable logging after configuration

  1. Open the CRM for Android app.

  2. While on the dashboard, tap the ellipses (…) in the bottom-right corner to display the command bar.

    Ellipses to sign out

     

  3. Tap Settings, and then tap Sign out.

  4. On the sign-in page, tap the back button to go to the set up page.

  5. On the setup page for CRM for tablets, tap the ellipses (…) to display the option to enable logging.

    Enable logging for Android

     

  6. Tap the Enable Logging checkbox.

View the Android log files

  1. 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.

  2. Open the MSCRM folder, then select and view the log file.

    Example Android 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 Monitoring Pack for Microsoft Dynamics CRM 2013

The System Center Monitoring Pack for Microsoft Dynamics CRM 2013 enables you to administer the Microsoft Dynamics CRM 2013 application in Microsoft System Center Operations Manager.

When available, you can download the System Center Monitoring Pack for Microsoft Dynamics CRM 2013 and System Center Monitoring Pack for Microsoft Dynamics CRM 2013 Guide.

Microsoft Dynamics CRM 2013 performance counters

Microsoft Windows includes a tool named Windows Performance Monitor. You can configure Windows Performance Monitor to obtain and display performance data as system components run on a Microsoft Dynamics CRM deployment.

Performance objects provide sets of counters that generate data about how various components perform as they run in your Microsoft Dynamics CRM environment. For example, the Processor object collects metrics that show how one or more microprocessors are performing on a particular server.

Many performance objects are built into the operating system, and more are installed with software applications and services. For example, the performance objects installed with SQL Server and Exchange Server can help you monitor the performance of components that are relevant to your system.

Monitor performance counters for a Microsoft Dynamics CRM 2013 application, such as Microsoft Dynamics CRM for Outlook, Email Router or Microsoft Dynamics CRM Server

  1. On the computer where the Microsoft Dynamics CRM application is installed, click start perfmon.

  2. In the navigation pane of the Reliability and Performance Monitor window, select Performance Monitor.

  3. Click the Add (plus sign) toolbar icon in the right pane to open the Add Counters dialog box.

    Alternatively, you can create a new Data Collector Set to organize the CRM counters that you want to monitor. For more information, see the Performance Monitor Help.

  4. In the list of available performance objects, expand the object class that you want to monitor. Most Microsoft Dynamics CRM performance object classes begin with “CRM.” For example, select CRM Server to see the list of available counters for that object.

  5. Highlight the names of the counters that you want to monitor, click Add, and then click OK. The selected counters are added to the list of active counters in the Reliability and Performance Monitor window, and the data that they generate is shown in the dynamic graph.

For more information about Microsoft Dynamics CRM Server 2013 performance counters, download Microsoft Dynamics CRM Performance Counters.

  

See Also

Operating Guide for Microsoft Dynamics CRM 2013 (on-premises)
Change a Microsoft Dynamics CRM service account or AppPool identity
Update Microsoft Dynamics CRM 2013

© 2016 Microsoft Corporation. All rights reserved. Copyright