Skip to main content

Notifications

Power Apps - Connector Development
Unanswered

custom connector logs

(0) ShareShare
ReportReport
Posted on by

Hi, I have created 3 custom connectors and using them in the app.
I want to know the outputs and inputs processed by the custom connectors.
where will it get stored and how can I access the logs and activities related to the connector failures etc. 

  • iBro Profile Picture
    iBro 56 on at
    Re: custom connector logs

    Hi,

     

    This is a sample code mentioned in an article at http://never-stop-learning.de/logging-in-custom-connector-code/ .

    The log can be viewed in the connector testing page.

     

    public class Script : ScriptBase
    {
     public override async Task<HttpResponseMessage> ExecuteAsync()
     {
     HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK);
     Context.Logger.LogTrace("Script started");
     
     // Logging an information
     Context.Logger.LogInformation($"Operation [{Context.OperationId}] {Context.Request.Method} {Context.Request.RequestUri} was called.");
     
     // Logging errors
     try
     {
     throw new Exception("This is an error.");
     }
     catch (Exception ex)
     {
     Context.Logger.LogError($"An error occurred: {ex.Message}");
     Context.Logger.LogCritical("This is critical");
     }
    
     // Logging warnings
     if (true)
     {
     Context.Logger.LogWarning("A warning message here.");
     }
    
     response.Content = CreateJsonContent("{\"message\": \"Hello World\"}");
     return response;
     }
    }

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard

Featured topics