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

Notifications

Announcements

No record found.

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
    301,037 Super User 2025 Season 2 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
    237,904 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 544 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 450 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans