This is an automated email from the ASF dual-hosted git repository.

shahar1 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 46845a1ed2c Migrate Stackdriver logging config to RemoteLogIO pattern 
(#66513)
46845a1ed2c is described below

commit 46845a1ed2c3e2969a669b594724d966198cf82d
Author: Haseeb Malik <[email protected]>
AuthorDate: Tue Jun 2 14:55:28 2026 -0400

    Migrate Stackdriver logging config to RemoteLogIO pattern (#66513)
---
 .../config_templates/airflow_local_settings.py     | 24 ++++++++++++++--------
 .../test_airflow_local_settings.py                 |  6 +++++-
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git 
a/airflow-core/src/airflow/config_templates/airflow_local_settings.py 
b/airflow-core/src/airflow/config_templates/airflow_local_settings.py
index 7072d2dd6ea..e30e68fb179 100644
--- a/airflow-core/src/airflow/config_templates/airflow_local_settings.py
+++ b/airflow-core/src/airflow/config_templates/airflow_local_settings.py
@@ -248,19 +248,25 @@ if REMOTE_LOGGING:
         )
 
     elif remote_base_log_folder.startswith("stackdriver://"):
+        from airflow.providers.google.cloud.log.stackdriver_task_handler 
import StackdriverRemoteLogIO
+
         key_path = conf.get_mandatory_value("logging", "GOOGLE_KEY_PATH", 
fallback=None)
         # stackdriver:///airflow-tasks => airflow-tasks
         log_name = urlsplit(remote_base_log_folder).path[1:]
-        STACKDRIVER_REMOTE_HANDLERS = {
-            "task": {
-                "class": 
"airflow.providers.google.cloud.log.stackdriver_task_handler.StackdriverTaskHandler",
-                "formatter": "airflow",
-                "gcp_log_name": log_name,
-                "gcp_key_path": key_path,
-            }
-        }
 
-        DEFAULT_LOGGING_CONFIG["handlers"].update(STACKDRIVER_REMOTE_HANDLERS)
+        REMOTE_TASK_LOG = StackdriverRemoteLogIO(
+            **cast(
+                "dict[str, Any]",
+                {
+                    "base_log_folder": BASE_LOG_FOLDER,
+                    "gcp_log_name": log_name,
+                    "gcp_key_path": key_path,
+                    "delete_local_copy": delete_local_copy,
+                }
+                | _io_kwargs,
+            )
+        )
+
     elif remote_base_log_folder.startswith("oss://"):
         from airflow.providers.alibaba.cloud.log.oss_task_handler import 
OSSRemoteLogIO
 
diff --git 
a/airflow-core/tests/unit/config_templates/test_airflow_local_settings.py 
b/airflow-core/tests/unit/config_templates/test_airflow_local_settings.py
index d131efa0026..088bc4bcca9 100644
--- a/airflow-core/tests/unit/config_templates/test_airflow_local_settings.py
+++ b/airflow-core/tests/unit/config_templates/test_airflow_local_settings.py
@@ -40,8 +40,12 @@ REMOTE_IO_PROVIDERS = [
     ),
     ("oss://bucket/path", 
"airflow.providers.alibaba.cloud.log.oss_task_handler.OSSRemoteLogIO"),
     ("hdfs://host/path", 
"airflow.providers.apache.hdfs.log.hdfs_task_handler.HdfsRemoteLogIO"),
+    (
+        "stackdriver://host/path",
+        
"airflow.providers.google.cloud.log.stackdriver_task_handler.StackdriverRemoteLogIO",
+    ),
 ]
-REMOTE_IO_IDS = ["s3", "wasb", "gcs", "cloudwatch", "oss", "hdfs"]
+REMOTE_IO_IDS = ["s3", "wasb", "gcs", "cloudwatch", "oss", "hdfs", 
"stackdriver"]
 
 
 @pytest.fixture

Reply via email to