From a594a7a221a34eaad3d998e83ec665b70b59a230 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 17 Jun 2025 15:12:05 -0700 Subject: [PATCH 1/2] fix: align WSGI logging level with ASGI when execution ID logging is enabled When LOG_EXECUTION_ID is enabled, the WSGI implementation was setting the root logger to WARNING level, which silenced info-level logs. This was inconsistent with: - The ASGI implementation which correctly uses INFO level - The default setup_logging() function which also uses INFO level This change ensures that logger.info() calls are visible in both WSGI and ASGI stacks when execution ID logging is enabled. --- src/functions_framework/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions_framework/__init__.py b/src/functions_framework/__init__.py index 22fbf44c..df4683cb 100644 --- a/src/functions_framework/__init__.py +++ b/src/functions_framework/__init__.py @@ -437,7 +437,7 @@ def _configure_app_execution_id_logging(): "stream": "ext://functions_framework.execution_id.logging_stream", }, }, - "root": {"level": "WARNING", "handlers": ["wsgi"]}, + "root": {"level": "INFO", "handlers": ["wsgi"]}, } ) From 5b09f061fef75573439de870a764dff9b9f16c4a Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Tue, 17 Jun 2025 22:01:00 -0700 Subject: [PATCH 2/2] fix: set default logging level for asgi logger to WARNING to match wsgi behavior. --- src/functions_framework/__init__.py | 2 +- src/functions_framework/aio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/functions_framework/__init__.py b/src/functions_framework/__init__.py index df4683cb..22fbf44c 100644 --- a/src/functions_framework/__init__.py +++ b/src/functions_framework/__init__.py @@ -437,7 +437,7 @@ def _configure_app_execution_id_logging(): "stream": "ext://functions_framework.execution_id.logging_stream", }, }, - "root": {"level": "INFO", "handlers": ["wsgi"]}, + "root": {"level": "WARNING", "handlers": ["wsgi"]}, } ) diff --git a/src/functions_framework/aio/__init__.py b/src/functions_framework/aio/__init__.py index 4245f2d1..e30b5f99 100644 --- a/src/functions_framework/aio/__init__.py +++ b/src/functions_framework/aio/__init__.py @@ -172,7 +172,7 @@ def _configure_app_execution_id_logging(): "stream": "ext://functions_framework.execution_id.logging_stream", }, }, - "root": {"level": "INFO", "handlers": ["asgi"]}, + "root": {"level": "WARNING", "handlers": ["asgi"]}, } )