azureazure-logic-apps

Where to find my ILogger output in the Azure portal


Using inline csx script and ILogger passed in

https://techcommunity.microsoft.com/t5/azure-integration-services-blog/announcement-introducing-net-c-inline-action-for-azure-logic/ba-p/4160541

But damned if I can't remember where in the Azure portal to find my logs.


Solution

  • You can find it Application Insights linked with Logic Apps, Logs are logged in Logs Section.

    Design:

    enter image description here

    C# Inline code:

    #r "Newtonsoft.Json"
    #r "Microsoft.Azure.Workflows.Scripting"
    using Microsoft.AspNetCore.Mvc;
    using Microsoft.Extensions.Primitives;
    using Microsoft.Extensions.Logging;
    using Microsoft.Azure.Workflows.Scripting;
    using Newtonsoft.Json.Linq;
    
    public static async Task<RithRes> Run(WorkflowContext context, ILogger rilg)
    {
      rilg.LogInformation($"Hello Rithwik, From Ilogger"); 
      return new RithRes
      {
        Message = "Rithwik"
      };
    }
    public class RithRes
    {
      public string Message {get; set;}
    }
    

    Output:

    In Logs section Of Linked Application Insights resource, Then use traces command as below:

    Monitoring (Section Of Logic apps) --> Logs-> traces (Query)

    enter image description here