Azure Functions

Anonymous
2020-09-22T01:29:03.3+00:00

Hello,

We are deploying a series of Azure Functions in Python that contain application logging. It follow the following guidance in documentation https://video2.skills-academy.com/en-us/azure/azure-functions/functions-reference-python#logging

A couple of things are not clear to me

1) When developing locally only the "info" log level is outputted. It is not clear how to view other log levels or how to set logger threshold.

2) When published, log output are not seen at all either in the Live Log Streams, ( Azure Functions App -> Functions -> My Function -> Monitor ->Logs ) or within the trace table in Application Insight.

Any insight on these two would be appreciated.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,907 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,221 Reputation points
    2020-09-25T12:11:03.85+00:00

    anonymous user When you are running locally and testing your application all the error will be disabled at the terminal. I have tested and didn't observe any issues. For logging you can refer to this

    In the host.json I have defined as below:

    {  
      "version": "2.0",  
      "logging": {  
        "applicationInsights": {  
          "samplingSettings": {  
            "isEnabled": true,  
            "excludedTypes": "Request"  
          }  
        },  
        "logLevel": {  
          "Host.Triggers.Warmup": "Trace"  
        }  
      },  
      "extensionBundle": {  
        "id": "Microsoft.Azure.Functions.ExtensionBundle",  
        "version": "[1.*, 2.0.0)"  
      }  
    }  
    

    Native Streaming logs would be a better option and if you want you can also configure the application Insights as mentioned in the monitoring function

    If you are still facing the issue that the logs are not transferred to application insights or the logs are not visible in local while debugging then I wish to engage with you offline for a closer look and provide quick and specialized assistance, please send an email with the subject line “Attn:Mayank” to AzCommunity[at]Microsoft[dot]com referencing this thread along with the function app resource name and subscription ID.


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.