In past versions of Dynamics CRM (2011 or newer), developers have commonly utilized the ITracingService interface to log run-time information to help debug problems in plug-in execution. The ability to view these trace logs has been a bit limited however. The developer could return an exception from the plug-in back to CRM in a dialog window that allows the end user to "Download Log File"; or if the plug-in was registered asynchronously, the tracing information is shown in the System Jobs.
Available with the Spring Update 1 of CRM 2015, system administrators and developers can now configure CRM to write trace logs to a new CRM entity. These logs can then be viewed within the CRM web application. By default, permission to view the logs is enabled for System Administrators and System Customizers, but can be granted to other users.
NOTE: Trace logs will only be written to the trace log entities if the plug-in developer uses tracing within the plug-in.
Enable Plug-In Trace Logging
Before using this feature, Plug-In Trace Logs must be enabled in your CRM organization. To do this:
In the CRM Web application, navigate to Settings à Administration
- On the Administration page, select System Settings.
- On the System Settings dialog window, select the Customizations tab
- In the setting for Plug-In and Custom Workflow Activity Tracking choose one of the below options:
- Off (default): feature turned off
- Exceptions: the trace logs will be written to the CRM entities only if the developer returns the exception back to the user.
- All: the trace logs will be written to the CRM entities whenever the plugin/workflow code is run, regardless of whether an exception is returned.
NOTE: As of the writing of this blog, the CRM 2015 Spring Update Preview release did not show the "All" option.
5. Click OK to save the settings.
Once the feature is enabled, you should be able to view any trace logs written to CRM from within the CRM web application. To view the logs, do the following:
View Plug-In Trace Logs
There are two ways to view the trace logs within CRM.
In the CRM web application, select Settings and under the Customizations menu, select Plug-In Trace Logs.
2. Similar to System Jobs, you can read the Plug-In Trace Logs via a View format common to the CRM web application. As you can imagine, this will allow administrators/developers more granular control over diagnosing plug-in errors over time.
You can also use Advanced Find to build a query to view Plug-In Trace Logs. These Views will be visible not only within the Advanced Find
interface, but also in the Plug-In Trace Logs area (see above). While the filtering options are limited to a subset of the Plugin Trace entity fields, this feature provides the ability for administrators and developers to zero in on a subset of logs so you can focus troubleshooting on the logs you need.
Microsoft continues to not only enhance the features and platform capabilities of Dynamics CRM, but they continue to provide simple, powerful tools like the Plug-In Trace Logs to improve the development and administration of Dynamics CRM…the greatest business development platform on the planet! Make sure to check out our ever-so-popular Spring Wave Top 10 list for even more on Update 1!