An Azure service that provides an event-driven serverless compute platform.
Hi @Wessel Vonk ,
Thank you for the additional information.
Based on the provided host.json, the Function App is already configured with "default": "Debug", therefore the behavior does not appear to be caused by log-level filtering.
Since the issue only occurs when logs are emitted through the custom StreamHandler, while the standard/root logger preserves the expected severity mapping, the custom console logging path appears to be the differentiating factor.
Azure Functions documentation describes the supported Python logging flow as:
Python Worker → Functions Host → Application Insights / Log Analytics.
Reference: https://learn.microsoft.com/azure/azure-functions/configure-monitoring
When the standard Functions logging pipeline is used, severity information is expected to be preserved. In your testing, this is consistent with the behavior observed when using the root logger.
At this time, we are not aware of any Microsoft-documented configuration that guarantees preservation of DEBUG and CRITICAL severity levels when logs are emitted through a custom logging.StreamHandler and ingested via the Host.Function.Console category.
Therefore, if accurate severity mapping in FunctionAppLogs is required, the recommended approach is to use the standard Azure Functions logging pipeline (root logger / Functions logging APIs) rather than a custom StreamHandler.