Loggin HTTP traffic in BC SaaS

AitorEG
Member Posts: 342
Hi all,
Is there any way to log the http traffic into a BC cloud tenant?
The thing is that I have created an integration with an external service. I'm sending a job with the related tasks and planning lines to that service.
Each entity creates an entry into the external Service, I know that the call via HTTP post is correct, because I can see all the created entries into the service. For each entry, the service returns to BC (http response) the entry no., that I need to save into a new field in the related job/task/job planning line. But sometimes, I found that the field is not loaded, although I don't get any error.
I must know what has happened, may be it can be a performance issue because of the quantity of HTTP calls, a timeout... I feel that I cannot control what his happening when HTTP calls come into play.
Any idea or hint on how to monitorize all those calls?
Thank you
Is there any way to log the http traffic into a BC cloud tenant?
The thing is that I have created an integration with an external service. I'm sending a job with the related tasks and planning lines to that service.
Each entity creates an entry into the external Service, I know that the call via HTTP post is correct, because I can see all the created entries into the service. For each entry, the service returns to BC (http response) the entry no., that I need to save into a new field in the related job/task/job planning line. But sometimes, I found that the field is not loaded, although I don't get any error.
I must know what has happened, may be it can be a performance issue because of the quantity of HTTP calls, a timeout... I feel that I cannot control what his happening when HTTP calls come into play.
Any idea or hint on how to monitorize all those calls?
Thank you
0
Best Answers
-
Maybe this will help: Log the complete response (of the external service) in a blob field or write additional logic that handles http codes <> 200. If everything is Ok you should get a HTTP 200 OK, else you should get another HTTP Status Code.5
Answers
-
Maybe this will help: Log the complete response (of the external service) in a blob field or write additional logic that handles http codes <> 200. If everything is Ok you should get a HTTP 200 OK, else you should get another HTTP Status Code.5
-
Firsft of all, thnak ypu for your answer.
That approach you are giving is the one I0ve been using. Not in a blob field, that's true. But I created a Log table, with a big text field, where I save data in different points of the development. This is because when something fails, we can't debug anything so I save that races. But here we found the main problem.
Imagine that I make 50 request, with their 50 responses. If the process fails in one point, a rollback is made, so all the saved logs are deleted. And appart from that, saving a log in an extra table won't penalize the performance of the development?
Anyway, I used commits when saving into the log table, but I found erros like "Already exists a log whit entry no. XXXX", probably due to the bad use of commits...
Thank you again!0 -
Thanks for your answer @ftornero.
That seems to be a solution to the rollback issue.
Might be something like this?[TryFunction] local procedure SEND() begin //all the procedure and the call, saving the log? end; trigger OnRun() begin if SEND then //possitive log else //negativo log end;
I must find the correct way to change the code to this new scenario
Muchas gracias!0 -
Firsft of all, thnak ypu for your answer.
That approach you are giving is the one I0ve been using. Not in a blob field, that's true. But I created a Log table, with a big text field, where I save data in different points of the development. This is because when something fails, we can't debug anything so I save that races. But here we found the main problem.
Imagine that I make 50 request, with their 50 responses. If the process fails in one point, a rollback is made, so all the saved logs are deleted. And appart from that, saving a log in an extra table won't penalize the performance of the development?
Anyway, I used commits when saving into the log table, but I found erros like "Already exists a log whit entry no. XXXX", probably due to the bad use of commits...
Thank you again!
Try choosing another primary field in your Log table. In my Log Table I have 1 primary key field of type Integer. Also enable the AutoIncrement = True property. Now you don't have to worry about 'Already exists messages'0 -
irasoelbaks wrote: »Firsft of all, thnak ypu for your answer.
That approach you are giving is the one I0ve been using. Not in a blob field, that's true. But I created a Log table, with a big text field, where I save data in different points of the development. This is because when something fails, we can't debug anything so I save that races. But here we found the main problem.
Imagine that I make 50 request, with their 50 responses. If the process fails in one point, a rollback is made, so all the saved logs are deleted. And appart from that, saving a log in an extra table won't penalize the performance of the development?
Anyway, I used commits when saving into the log table, but I found erros like "Already exists a log whit entry no. XXXX", probably due to the bad use of commits...
Thank you again!
Try choosing another primary field in your Log table. In my Log Table I have 1 primary key field of type Integer. Also enable the AutoIncrement = True property. Now you don't have to worry about 'Already exists messages'
Thanks for your answer.
Using autoincrement instead of calculating the new entryNo in the onInsert event?0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions