In the earlier vesions of CRM, we used to use ITracingService for tracing the plugin errors and that information is shown in System Jobs.
With the new release of CRM 2015 Update, we can configure CRM to write trace logs to CRM new entity and can be viewed in CRM. By default, CRM Administrators has the permission to view the logs.
Trace logs will only be written to the trace log entities if the plug-in developer uses tracing within the plug-in.
How to Enable Plugin Trace Log
- In the CRM Web application, navigate to Settings à Administration
- Select System Settings à Customization on the Administration page
- 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.
After you enable the feature, we should be able to see the logs in CRM.
In the CRM, select Settings and under the Customizations menu, select Plug-In Trace Logs.
Now let us see it more in depth by creating a plugin.
Here is my plugin code.
public void Execute(IServiceProvider serviceProvider)
IPluginExecutionContext context = (IPluginExecutionContext) serviceProvider.GetService(typeof(IPluginExecutionContext));
IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = factory.CreateOrganizationService(context.UserId);
ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));
tracingService.Trace(“Trace Start Check”);
throw new Exception(“Exception Thrown”);
catch (Exception ex)
I have registered the plugin on Account update
Opened an account record and updated it. The system has records in Plugin Trace Log and here are the details.