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, ...
Suggested Answer

How to track log file in custom service

(1) ShareShare
ReportReport
Posted on by 964

Hi team,

As per my requirement, I going to develop as per the customer requirement. 

 

I know like, i need to implement 

Request

Response

Service class and need to create service group and then need to deploy it . So that I will ashre this API with external application to consume the data from D365FO 

 

Here , i am worried, if for any reason, if it's failed to consume then how will I track the log file?

 

I mean to say, which are the best approach to implement it and where to look to find out the root cause.

 

Pls advise, thanks 

Categories:
I have the same question (0)
  • Suggested answer
    Assisted by AI
    CU-1234529-002 Profile Picture
    293 on at

    Hi, good question. For tracking failures in custom services, here are the best approaches:

    Infolog/Event Log — add try/catch in your service class and log errors using info(), warning() or error() so failures are captured in the infolog.

    Custom log table — create a staging/log table in D365FO to store each request, response, status and error message. This gives you full visibility of every call made.

    Application Insights — integrate with Azure Application Insights to monitor API calls, failures and exceptions in real time from outside D365FO.

    Trace Parser — if the issue is on the D365FO side (X++ execution), use Trace Parser to drill down into what happened during that service call.

    For the external system side, always ask them to log the HTTP response code and error message they receive — that helps quickly identify whether the failure is on D365FO side or their side.

    Best practice is to combine a custom log table (for business-level tracking) with Application Insights (for technical monitoring). Thanks,

  • Suggested answer
    Martin Dráb Profile Picture
    240,618 Most Valuable Professional on at

    What do you mean by “if it's failed to consume”? The AI bot above assumes that the custom service gets successfully called, but it doesn't have to be the cause. Maybe F&O is down for maintenance, the call can't authenticate etc., and logging in F&O couldn't help you if the call never reaches F&O. Please explain what kind of failure you want to address, so we can design an appropriate solution.

     

    Also, AI is kidding when saying that method like info() produce exceptions that you catch. Exceptions are thrown by the throw keyword.

     

    The idea that you can log things like HTTP requests and response code to a custom table inside the custom service is wrong too, because you don't have that available inside the custom service, and some failures (such as a wrong payload format) mean that the custom service won't execute at all. You could, for example, route all requests through Azure API Management and enable logging there.  

  • CU10121822-0 Profile Picture
    964 on at

    Hi Martin,

     

    Is it something similar like this?

     

    It's conceptual diagram.

     

    Pls advise, thanks 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
Martin Dráb Profile Picture

Martin Dráb 361 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 329 Super User 2026 Season 2

#3
CU10121822-0 Profile Picture

CU10121822-0 324

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans