Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
Should we enable CRM tracing via the Registry or Powershell?
Answer: It depends.
Let me explain. First, let’s talk about why you would turn on CRM Platform tracing. If you encounter and error in CRM and you are not able to determine the resolution to the issue by the error message and\or downloading the platform error from the error message; the next step you may want to do is to enable CRM platform tracing. The CRM platform trace can give you more details about the entire call stack and verbose actions leading up to the error. This would be true for errors received in the CRM web client and in most cases errors in the CRM Outlook client. However, there is client side tracing you can enable as well if the error does not appear to be a server side error message. First let’s focus on server side tracing and then later I will include some details on client side tracing.
We have a KB article about How to enable platform tracing in Microsoft Dynamics CRM. This method walks you through enabling CRM platform tracing through the registry. There are also some third party tools like the Diagnostics Tool for Microsoft Dynamics CRM 2011 available on the Internet that customers and partners have written to automate this process. Even though those are not official Microsoft support tools, they are very commonly used with customers and partners and I personally haven’t seen any issues using these tools.
The registry is an effective way to enable platform tracing when you are troubleshooting an issue on a single CRM server. You can add the registry keys and you can leave them in place after you disable tracing, so that you can re-use them if needed at a later time. To disable tracing, you can simply change the TraceEnabled registry value to 0 and you also have to change the TraceRefresh value to a different number. I always just increment the decimal number by one. It’s very important to disable tracing when you are done troubleshooting, or you will fill up your C: drive.
Which leads us to my next point which is that the TraceDirectory is always ignored and no matter what you set this value to, the trace files will always go to <Install Drive>:\Program Files\Microsoft Dynamics CRM\Trace. Even if you change this in the registry or in a third party tool, the trace file will always go to the same directory. Typically this is not too big of an issue, unless you installed CRM on a drive that does not have much available hard drive space and then you have to enable tracing for a long period of time.
Windows PowerShell is another method that you can use to enable CRM platform tracing when you want to quickly enable tracing for an entire CRM deployment. This can be very effective when you have multiple CRM servers vs. going to each CRM server and enabling tracing via the registry. This topic is also covered in the How to enable platform tracing in Microsoft Dynamics CRM KB article.
When tracing is enabled via PowerShell you should specify a different trace directory location to store the trace files. By default CRM is set to use C:\crmdrop\logs, but since it's very likely that location does not exist on your CRM servers, you will think that tracing was not enabled correctly as you are looking in the <Install Drive>:\Program Files\Microsoft Dynamics CRM\Trace folder for the trace files. You either have to update the TraceDirectory via PowerShell to that default location which already exists, or create a different location manually and specify that location (ie: D:\CRMTrace) using PowerShell. I recommend this option, so that you do not risk filling up your primary C: drive with CRM trace files.
So, as you can see the answer to use the registry or PowerShell can depend on the scenario you are troubleshooting, type of environment you have an where you want to store the log files. There is no right or wrong answer, so just use what makes sense for you and your CRM deployment based on the information provided in this blog post.
What about the CRM Outlook client tracing mentioned above? If you were unable to find the error details in the CRM server platform trace and you suspect it’s a client side issue, you can enable CRM platform tracing on the CRM Outlook client machine. Keep in mind that this only applies to the CRM Outlook clients and not the CRM web clients. If you are using CRM through a web browser only, then you would just use server side platform tracing. That’s why the first thing I do when there is an issue with the CRM Outlook client is to try reproduce the issue in the CRM web client to help reduce the complexity of troubleshooting the issue.
You can enable CRM platform tracing on the CRM Outlook client by going to Start, All Programs, Microsoft Dynamics CRM 2011, Diagnostics. If you are using Windows 8 or 8.1, you can simply click the Windows key and start typing: Diagnostics. Then click on the CRM Diagnostics tile. When you are in the CRM Outlook client diagnostics tool, select the Advanced Troubleshooting tab, and then select Tracing to enable or click to clear Tracing to disable and then click Save. After you reproduce the issue, disable tracing and the CRM for Outlook tracing files are located in the C:\Users\<username>\AppData\Local\Microsoft\MSCRM\Traces folder. For additional details on CRM Outlook client tracing, please refer to our documentation on MSDN.
Hopefully this helps to clear up some of the CRM platform tracing questions you have, or may have had at some point while working with CRM platform tracing.
As always our CRM PFE and CRM Support teams are ready to help if you need the assistance. In addition, we have a plethora of other services we offer such as developer training, admin workshops, and code reviews. If you would like to have another Microsoft PFE or I visit your company and assist with the ideas presented on our blog, contact your Microsoft Premier Technical Account Manager (TAM) for booking information. For more information about becoming a Microsoft Premier customer email PremSale@microsoft.com, tell them CRMInTheField or I sent you.
Please share any other helpful tips or tools that you use for CRM platform tracing in the comments below.
Thanks! Shawn Dieken
Microsoft Premier Field Engineer
Business Applications communities