Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
The out of box Plugin Tracing introduced in CRM 2015 SP1 has made tracing plugins within Microsoft Dynamics 365 for Customer Engagement a much more streamlined process. Being able to control what is logged from a system level (nothing, exceptions only, or all) also helps to ensure you only are only incurring the cost of logging when desired.
Unfortunately, there is no support out of the box for enabling/disabling tracing at a plugin specific level. This becomes even more apparent when developers are trying to troubleshoot a plugin and haven’t added any additional logging. Normally this requires the developer to make additional logging calls in the plugin; recompile, redeploy, and retest, and then go back and remove the additional logging when the cause and fix have been determined. Not only is this extremely time intensive, it really isn’t an option for troubleshooting an issue in production.
A simple solution to this problem is to utilize a base plugin class for all plugins that conditionally logs the plugin context based on information in the Secure Configuration of the plugin registration. The result is if additional logging is desired for a particular plugin, you can enable/disable it via the plugin registration, without having to recompile, or redeploy code! The Secure Configuration is used since it isn’t migrated with solutions, so if you have the additional logging enabled in one environment, extracting the registration step via a solution and importing it into another environment will not affect tracing.
Below is a sample plugin base class that will trace the plugin context pre-plugin execution if “PluginBase.TracePreContext” is found in the Secure Configuration, and the context post-plugin execution if “PluginBase.TracePostContext” is found in the Secure Configuration, and both if “PluginBase.TraceContext” is found.
There you have it! Subscribe to our blog for more helpful tips and tricks!
Happy Dynamics 365’ing!
Business Applications communities