95
Business Central needs better logging tools to help Support and Development Teams to troubleshoot errors and performance issues that customers may experience when they use ISV extensions.

Dynamics GP has two different logging tools that are very useful:
1) Script log - Logs every script (i.e. procedure/function) that runs when the user performs actions in the user interface, including parameter values passed to the script, the order in which each script is called and the call stack (i.e. script caller / callee relationships). This is useful for troubleshooting errors and business logic issues.
2) Script profile - Shows how many times each script was called and the total processing time for all calls to that script. This is useful for troubleshooting performance issues.

As far as I can tell, the main logging tool in Business Central is the Event Recorder which records what I will call "event logs". I guess it's *somewhat* similar to Dynamic GP's script log in that it shows events that occurred and the order they occurred in. But I don't think it shows sub-procedures called by your event handlers and I don't think it shows the caller/callee relationships (indicated by indents in Dynamics GP's script log).

Also, saving *all* of the recorded events to a file is very cumbersome. To save *all* events, you must first scroll through all of them in the Event Recorder window to ensure that Business Central has loaded *all* of them. Next, you have to hit Ctrl-A and then Ctrl-C. Next you have to open an Excel file and use Ctrl-V to paste the events. It would be great if there was just one button to save all of the recorded events to a file!

As far as troubleshooting performance issues goes, it seems that Business Central does not have a log similar to Dynamics GP's script profile. Please add a logging tool similar to that.

Regards.
Category: Development
STATUS DETAILS
Under Review
Ideas Administrator

Thank you for your feedback. Please continue voting on this idea. 

Note that 2020 Wave 2 has two related tools (but not addressing idea ask directly):
  • Snapshots for capturing execution in production and replay in debugger offline (in preview at launch, only enabled in sandboxes)
  • Performance toolkit for measuring app performance as part of developing
Also note that debugging in sandbox (as a copy of prod) allows investigating amount of SQL calls and execution time. There are also a number of recent telemetry options for the same (with possibility to set out automatic monitors/notification in AppInsights). See aka.ms/bctelemetry


Best regards,
Business Central Team

Comments

J

Telemetry in Business Central is not particularly useful right now. In the BC Telemetry, there is no way to search events or filter them for anything other than a time range. In addition, Telemetry does not have a way to export to Excel or report on events.

The issue with the event recorder, at least for me, is that it only records events from the current session. This makes it impossible to see events that were triggered by an API call.

Improvements to both the event recorder and Telemetry are needed in Business Central.

Category: Development

J

Hi Arthur, thanks for adding to this discussion. I have briefly looked into the Azure Insights for telemetry (I assume that's what you mean by Application Insights) and, in my opinion, it has several shortcomings compared to GP's Script Log and Script Profile tools:
1) Azure Insights for telemetry requires the ISV to add an instrumentation key to the app.json file. GP's tools do not. They work out of the box without having to add an instrumentation key.
2) As far as I can tell, Azure Insights for telemetry does not seem to have the same level of fine-grained logging that GP's tools do. For example, when GP's Script Log tool is turned on, it shows you each and every procedure and function that is called when the user runs a process in GP. Not only do you see each and every call but you also see the parameter values that are passed to each call and you see the stack trace (that is, the caller-callee relationships and the order of each call). Furthermore, the Script Log shows not only your product's calls but also other ISV product calls and calls made by GP itself. Regarding GP's Script Profile tool, when it is turned on, it shows you how many times each procedure or function is called and the total processing time for all of those calls. That makes it VERY easy to spot the root cause of a performance issue.
3) GP's Script Log and Script Profile tools are accessible by the End User right out of the box. That means if a user opens a support case with an ISV, we can ask the user to run the process with logging turned on and then can email us the logs without requiring any action or intervention by the ISV.
4) Correct my if I am wrong but Azure Insights for telemetry seems like it only works with Business Central instances that are running on Azure. What if I am a Developer who is running Business Central in Docker? How do I get logging there? If Business Central had logging tools like GP's Script Log and Script Profile, I would be able to run them in Docker.

Category: Development

J

I think the way forward is to embrace Application Insights.

This wil not solve the questions you're addressing here right now, but I think (hope) Microsoft can add these to the telemetry, where then you can view, report en monitor these kind of support issues.

Category: Development

J

Just to be clear, my request is for two ***new*** tools: one like GP's Script Log tool and another like GP's Script Profile tool. In addition, it would be great if you could also add an Export To Excel button on the existing tool, the Event Recorder window.

Category: Development

J

If would be great if the BC Team could add an Export To Excel button on that Event Recorder window.

Category: Development