@Ershad Nozari In case of Azure functions and APIs you can leverage Application Insight and post custom logs (assuming it is C#) : https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library?tabs=v2%2Ccmd#log-custom-telemetry-in-c-functions
However, for logic app you can try log analytics. If you want something specific you may set Tracked property : https://www.serverlessnotes.com/docs/logic-apps-tracking-message-properties
or send data to log analytics : https://www.middleway.eu/azure-monitor-log-custom-data-through-azure-logic-apps/
https://www.cloudsma.com/2019/05/custom-log-analytics-logs-logicappsps/
You may take look into https://yourazurecoach.com/2018/08/05/end-to-end-correlation-across-logic-apps/ to use the correlation id throughout.
Let me know if this helps!