Since this topic comes up every once in a while, I decided to write a quick guide aimed at the beginner level on how to set the Logging Level of an Exposed or Consumed REST API to aid in debugging. This can be useful in case you need to see what's going on when e.g. the server reports an unhelpful "500 Internal Server Error", and you need to see what's going on.
That's about it. In case of errors, look for signs that there's something wrong, e.g. missing data, missing authentication headers, malformatted data, etc. Note that by default, the Platform doesn't send data that has the default value, so be aware that depending on the values of the data you send, not everything may appear (which could also be the source of a problem if an external REST API expects this data anyway).
EDIT (2021-04-29): Recently OutSystems updated its documentation for the above. It can be found here, and the reference on the various levels can be found here.
Very cool... thanks.
It really helpful
Thanks
Kilian Hekhuis wrote:
It's really a valuable info..Thanks for sharing!!
Sachin
Great stuff @kilian sir!!
Nice contribution!! Good Work!
Hi Kilian,
Thanks for this post!
May I know what performance issue will be caused by changing the Logging level to "Full"?
None, really. It's not adviced in production if you have large volumes of REST calls, and/or very large payloads, but on development and test you're pretty safe.
I cannot find eSpaces area now, 1/11/2019. It seems the interface design is changed
Pham Chinh wrote:
Hi,
For Personal Environments Espaces is renamed to Modules in Service Center Factory menu.
Regards,
Daniel
Yes, it was renamed "Modules" in version 11, thanks Daniël for pointing it out. Unfortunately, I can't edit the original post.
Thank you so much for sharing knowledge.
4. On the page that appears you can see what has been sent, and what has been replied. If there's more than about a page it's cut off, and you can press the "Download HTTP Trace" button to get a text file with the full trace. Note that in case of binary content, it will be encoded in Base64; to decode it google for "decode base64" and you'll find online tools to decode the data.
Thanks for the valuable info, Kilian! That part about downloading HTTP trace is also important as the inner exception is usually not visible in the truncated error message in Service Center.
You're most welcome Ozan! Happy coding :)
Stumbled upon this post while wondering the difference between "Troubleshoot" and "Full".
Here are the details from OutSystems documentation:
(https://success.outsystems.com/Documentation/11/Developing_an_Application/Troubleshooting_Applications/Troubleshoot_Service_Actions_Using_Logs#how-to-change-the-logging-detail-level-for-service-action)
The available logging levels for Service Action requests are the following:DefaultAll requests are logged including some basic information (like the date and time of the request). No details regarding errors, request headers or payloads are logged.TroubleshootOn top of the information kept by the Default level, error details are also logged. Click on the "Error" link displayed on the right to get more details about the error.FullOn top of the information kept by the Troubleshoot level, request headers and payloads are also logged. Click on the displayed "Error" link or, if there's no error, click on the "Details" link to obtain detailed logging information.
The available logging levels for Service Action requests are the following:
Default
Troubleshoot
Full
It seems to say "Troubleshoot" has "Full" logging for errors and "Default" for anything else.
Thanks for the addition Mikko. Though you reference a document for Service Actions, it's the same for REST and SOAP. For SOAP, the documentation is here, for REST, the documentation should be here but it's lacking, unfortunately.
Hello Guys,
I have an HTTP trace that is not fitting in the txt:
(Consumed REST APIs)
<Message truncated in logging because it exceeded the maximum size>
Logging Level = Full:
Plataform Version 10.0.708.0
How can i solve?
is there any configuration to be done on the server or configuration tool so that the entire error message is displayed in the txt trace?
Regards and Thank you.
Hi Agno,
I haven't seen this before. It seems you are sending very large documents as base64 binary content, which might've triggered this. However, looking at the database table the data is stored, the Detail column has nvarchar(max), which shouldn't have a limit. I'll ask around to see if someone from OS has more information.
thanks Kilian,
I will do an analysis.
Its really helpful!!!
Thank you, glad this old post is still useful :).
Thanks for sharing, Kilian; very useful!
It's very rare that some Azure APIs work well in test mode. But they don't support some features once executed:
{"error":{"code":"400","message":"Billing Period is not supported in (2019-10-01) API Version for Subscription Scope With Web Direct Offer. Please provide the UsageStart and UsageEnd dates in the $filter key as parameters. (Request ID: fb348927-3232-4b10-8a80-xxxxxxx)"}}
Well, that error message indicates to me that you didn't send everything as it would expect, so inspecting the full message would indeed be very helpful in troubleshooting. If you still have problems, I'd advise you to start a new topic on the forum, as it's not really related to the original topic of this post.
Very Nice ...
Thanks.
Thank you for sharing!