Logging error in Logic apps and Azure functions

Amar-Azure-Practice 661 Reputation points
2021-02-04T04:06:08.777+00:00

Hi

We have Azure logic apps and Azure functions,

Logic app is calling Multiple Azure functions, if any error occurs in Logic app or Azure functions we would like to track.
with same tracking id , we should be able to track the complete log and we should be able to find what are the steps it has completed and where the error occurred.

Please let me know how can implement

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
0 comments No comments
{count} vote

Accepted answer
  1. JayaC-MSFT 5,606 Reputation points
    2021-02-04T12:32:20.67+00:00

    @Amar-Azure-Practice In case of Azure functions 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!

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 15,256 Reputation points MVP Volunteer Moderator
    2021-02-04T09:19:47.96+00:00

    Hi @Amar-Azure-Practice

    You use logic app run starts with a trigger attempt - check trigger history.
    Troubleshoot and diagnose workflow failures in Azure Logic Apps

    And Monitor Logic Apps

    If the Answer is helpful, please click Accept Answer and up-vote, this can be beneficial to other community members.

    0 comments No comments

  2. Tymtsiv, Volodymyr - Consultant 1 Reputation point
    2021-02-10T15:23:57.36+00:00

    Hi @JayaC-MSFT @SUNOJ KUMAR YELURU ,

    It would be great it you could suggest how can we correlate logs between Logic apps and Azure functions in our case.

    Logic app calls Function. Them both have Diagnostic settings configured to send logs to Event Hub.
    A consumer of that event hubs receives messages with logs form Logic app and Function.
    And the problem is that Function logs could not be distinguished from which Logic app run it was triggered.

    So in case we called Logic app 3 times we get our Function triggered 3 times. But we can't find which run triggered which Function execution.

    I hoped that correlation.actionTrackingId from Logic app logs will be present in Function logs, but it's not.
    And there is no unique filed that we could use to connect both those calls.

    Do you have any ideas how to find out which Logic app run triggered a Function having only JSONs from event hub?

    Thanks in advance!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.