Azure Functions logs (FunctionAppLogs) table does not appear under LogManagement tables in Log Analytics Workspace.

Leonard Lee 31 Reputation points
2023-02-07T08:00:21.21+00:00

The test example to reproduce this issue was generated from this Quickstart: Create a C# function in Azure from the command line documentation.

Additional diagnostic setting was added as described in Monitoring Azure Functions with Azure Monitor Logs documentation.

Azure Functions logs / FunctionAppLogs table does not appear under LogManagement tables in Log Analytics Workspace.

Log stream displays the data, but logs were not consolidated into Log Analytics Workspace.

2023-02-06T11:30:35Z   [Information]   C# HTTP trigger function processed a request.

How can I further troubleshooting it?

Posted this question here as directed from this GitHub issue.

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,798 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,249 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
0 comments No comments
{count} vote

Accepted answer
  1. Stanislav Zhelyazkov 21,101 Reputation points MVP
    2023-02-08T09:59:20.5966667+00:00

    Hi,

    I believe in order to have data in that table you need to use ILogger. Also log level needs to be configured as well.

    Update: see comments as well.

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Leonard Lee 31 Reputation points
    2023-02-08T10:50:36.04+00:00

    I believe in order to have data in that table you need to use ILogger. Also log level needs to be configured as well.

    These are already setup properly from the example taken from this Quickstart: Create a C# function in Azure from the command line documentation.

    As I have mentioned, log stream displays the data, but logs were not consolidated into Log Analytics Workspace. Azure Functions logs FunctionAppLogs table does not appear under LogManagement tables in Log Analytics Workspace.

    The generated host.json file content is listed below.

    {
        "version": "2.0",
        "logging": {
            "applicationInsights": {
                "samplingSettings": {
                    "isEnabled": true,
                    "excludedTypes": "Request"
                }
            }
        }
    }
    

    I did try to use the below host.json file content, but to no avail.

    {
      version": "2.0",
      "logging": {
        "fileLoggingMode": "always",
        "logLevel": {
          "default": "Trace",
        },
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": false
          }
        }
      }
    }
    

  2. Chukwuka C. Ojini 0 Reputation points
    2023-11-08T06:56:28.47+00:00

    Have you tried changing the default from trace to information?

    Try this and let me know what works.

    "logging": {
        "fileLoggingMode": "always",
        "logLevel": {
            "default": "Information",
            "Host.Results": "Error",
            "Function": "Trace",
            "Host.Aggregator": "Trace"
        }
    }
    
    0 comments No comments