216
Views
12
Comments
How to setting logging level of a REST API in ODC

I need to change the "Logging Level" to "Full" for some REST APIs in ODC, I didn't find it on the portal, how can I enable this log?

2024-11-27 07-35-28
Aayush Shrivastava

Hey @Murilo Antonio de Souza,

Have you ever checked the Traces at ODC portal it contains much info when API fails.Hope this helps.

Kind ragards 

Aayush Shrivastava

2023-04-18 18-18-30
Murilo Antonio de Souza

HI Aayush.

Yes, I have already checked, this trace has several important information, but I need the request and response payload, which I could not find on the ODC portal.

Kind regards.
Murilo Antonio

UserImage.jpg
Piet Pieper

Has this been solved?

2019-03-12 09-44-05
Rodrigo Silva

I had the same problem. I've added a breakpoint in the OnBeforeRequest/OnAfterRepsonse and saw the details of request/response respectively. Also, you can log these info using the LogMessage server action.

2025-08-07 06-30-56
Amit J
Champion

As of now, ODC does not provide a direct option to adjust the logging level for REST APIs. By default, ODC captures standard logs and traces for REST API operations.

Monitoring REST API Activity in ODC:

  1. Access the Monitoring Section:

    • Navigate to the ODC Portal.
    • Click on the Monitoring section in the left navigation menu.
  2. View Logs and Traces:

    • Within the Monitoring section, select Logs or Traces to view recorded activities.
    • These logs provide insights into REST API requests, responses, and potential issues.

Alternative Approach for Enhanced Logging:

If you require more granular logging than what is currently available in ODC, consider implementing custom logging within your REST API logic:

  • Custom Logging Implementation:
    • Within your REST API methods, add logic to log specific details such as request payloads, response data, and error messages.
    • Store these logs in a dedicated data entity or an external logging service for analysis.
      I used to in my some project and always help to see the request/response json.
UserImage.jpg
Piet Pieper

I already use the logs in the ODC Portal, i just want these logs to be shown in my application. For people who do not have acces to the ODC Portal to be able to see them. 

2022-12-30 07-28-09
Navneet Garg

I don't find any api to get the logs from ODC portal. I think you need to create custom log to show or use some tool like grafana or datadog to capture the logs.

UserImage.jpg
Piet Pieper

I already created an apilogging the only issue is that i am still missing some stuff.

I will add the OML. so you can see what i created.

LoggingApp.oml
2022-12-30 07-28-09
Navneet Garg

ok Ill check and let you know. but can you please provide more detail about missing some stuff ?

UserImage.jpg
Piet Pieper

I want to put the Request and response into one record but i can't create a id in an onrequest and give that to the onresponse.

2022-12-30 07-28-09
Navneet Garg

you can use guid using GenerateGuid by this you can reference it in both events

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.