Skip to content
Microsoft Dynamics 365

Introduction

The following steps are one way to collect a series of AX traces on a schedule with all versions of AX 2012 on the AOS server, using standard Windows tools: Perfmon combined with Task Scheduler. This example collects a 1 minute trace at 5 minute intervals.

This can be useful for example if you want to trace a long running process such as a job that runs for hours, to get snapshots of the end to end process before narrowing down into more granular analysis.

The trace files can then be renamed and imported into Trace Parser to analyse the code and queries.

Due to the potential number and size of files generated (dependent on the process being traced), it is recommended that this is done on a test environment and that disk usage is monitored.

Disclaimer: Microsoft provides examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability or fitness for a particular purpose. These steps assume that you are familiar with the technologies that are being demonstrated and the tools that are used to create and debug procedures. 

Steps

1. Follow the blog post below to set up a data collector set in Perfmon and name it “AXTrace”.
http://blogs.msdn.com/b/axperf/archive/2011/11/18/collect-ax-2012-event-traces-with-windows-performance-monitor.aspx 

 

2. Add a stop condition in the properties of your data collector set, of 1 minute overall duration.

 

3. Start the task scheduler, e.g. by entering taskschd.msc in the run command.

4. You will create a task to run your data collector set every 5 minutes on demand. First choose ‘Create Basic Task…’.

 

5. Give your task a name, click Next.

6. Keep the default start date/time, click Next.

7. Choose ‘Start a program’.

 

 

  
9. Tick ‘Open the Properties dialog when I click Finish’. Click Finish.

 

 


11. On the triggers tab, click ‘Edit’.

 


13. Back in the main Task Scheduler window, right click on your task, then click Disable (to leave it disabled until you want to trace the process in AX).
 

 
14. Click ‘Run’ when you’re ready to trace your process in AX.

 

Default path is C:\PERFLOGS\[Username]\AXTrace (or you can find the path from the Output field in perfmon: see screenshot A above).

16. After running the process in AX, click ‘End’.
 

 

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!