web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to write trace (logs) for our code in X++ ?

(0) ShareShare
ReportReport
Posted on by 225

Hello,

Can anyone suggest the best practice to write trace (logs) for our code in X++. So in case of any issues we can collect that logs and find where the issue is. 

I have gone through Trace functionality of D365 F&O. where we can analyze that trace file in trace parser to collect performance related information but I think we can not write our logs in that. right ? let me know if I am missing anything here.

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    303,730 Super User 2026 Season 1 on at

    Hi Pratik,

    What exact issues are you expecting? What details you do want to store and where? Wouldn't be better to use the SysTest framework for automated testing? Or when you find an issue, you can use the debugger to find the root cause.

  • Martin Dráb Profile Picture
    239,040 Most Valuable Professional on at

    Standard logs are available in Event logs (on T1 environments) and in LCS (for other environments).

    If you want you create additional logs, you might be interested using Azure Application Insights.

  • barbarsav Profile Picture
    30 on at

    Hello Rami,

    As you said, Trace Parser is being used for perfomance issues. You can not add or remove anything from Trace file that client generates.

    If trace parser doesn't work for you, u can crate log table and specific fields in it and than insert records line by line while your customization code running like example below.(Insert type of log, type of business , execution timeStamp etc...). 

    pastedimage1618212179824v2.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 616

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 460 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 331 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans