Skip to content

Isolated Durable Functions: Filter logs with MS_DURABLE_FUNCTION_EVENTS_LOGS #3270

@jaliyaudagedara

Description

@jaliyaudagedara

Description

I have a .NET 10 Isolated Durable Function App running in Azure Container Apps (Linux).

Dockerfile

FROM mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated10.0 AS base
WORKDIR /home/site/wwwroot
EXPOSE 8080 80

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src

// Publish

FROM base AS final
WORKDIR /home/site/wwwroot
COPY --from=publish /app/publish .
ENV AzureWebJobsScriptRoot=/home/site/wwwroot

Build is running on ubuntu-latest, so the image is Linux.

In the Container Apps Environment, logs destination is configured to Azure Log Analytics.

While I can filter Application Insights logging with configuration (host logs via host.json and worker logs via appsettings.json, those doesn't seem to get honored for CAE Console Logs: ContainerAppConsoleLogs_CL.

Tried setting these, but didn't work.

Logging__Console__LogLevel__Default: Warning
Logging__EventLog__LogLevel__Default: Warning

Then noticed this:
https://github.com/Azure/azure-functions-durable-extension/blob/main/src/WebJobs.Extensions.DurableTask/LinuxAppServiceLogger.cs

Does this honor logging configuration?

Expected behavior

Logging configuration needs to be honored no matter where it's running.

Actual behavior

Logging configuration is not honored for ContainerAppConsoleLogs_CL

Relevant source code snippets

LoggerFilterOptions

{
  "MinLevel": "None",
  "Rules": [
    {
      "ProviderName": null,
      "CategoryName": "Azure.Storage.Blobs",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Azure.Messaging.EventHubs",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Azure.Core",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    },
    {
      "ProviderName": "Console",
      "CategoryName": null,
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": "EventLog",
      "CategoryName": null,
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.WebHostSystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": "None",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.WebHostSystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    },
    {
      "ProviderName": null,
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    },
    {
      "ProviderName": null,
      "CategoryName": "Host.Triggers.DurableTask",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Host.Results",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "Host.Aggregator",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Netherite.WorkItems",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Netherite.LoadMonitor",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Netherite.FasterStorage",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Netherite.Events",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Netherite.EventHubsTransport",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Netherite.Client",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Netherite",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask.Core",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": "DurableTask",
      "LogLevel": "Warning",
      "Filter": null
    },
    {
      "ProviderName": null,
      "CategoryName": null,
      "LogLevel": "Information",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": "None",
      "Filter": null
    },
    {
      "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
      "CategoryName": null,
      "LogLevel": null,
      "Filter": "<AddFilter>b__0"
    }
  ]
}

Known workarounds

Disable CAE Logs entirely, but prefer not to.

App Details

  • Microsoft.Azure.Functions.Worker.Extensions.DurableTask: 1.10.0
  • Microsoft.Azure.Functions.Worker: 2.51.0
  • Programming language used: C#

Screenshots

Image

If deployed to Azure

  • Orchestration instance ID(s): 048ea256253d4a8d9f42c3f5da5ccd99

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions