From 4a3ad3fac9c737cf66afec6cd1ed1e5743655b11 Mon Sep 17 00:00:00 2001 From: Joseph Bane Date: Mon, 11 Oct 2021 17:28:47 -0400 Subject: [PATCH] Set default wasb Azure http logging level to warning; fixes #16224 --- airflow/providers/microsoft/azure/hooks/wasb.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/airflow/providers/microsoft/azure/hooks/wasb.py b/airflow/providers/microsoft/azure/hooks/wasb.py index ad8cf2e7a0400..1840095615392 100644 --- a/airflow/providers/microsoft/azure/hooks/wasb.py +++ b/airflow/providers/microsoft/azure/hooks/wasb.py @@ -26,6 +26,8 @@ """ +import logging +import os from typing import Any, Dict, List, Optional from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError @@ -112,6 +114,12 @@ def __init__( self.public_read = public_read self.blob_service_client = self.get_conn() + logger = logging.getLogger("azure.core.pipeline.policies.http_logging_policy") + try: + logger.setLevel(os.environ.get("AZURE_HTTP_LOGGING_LEVEL", logging.WARNING)) + except ValueError: + logger.setLevel(logging.WARNING) + def get_conn(self) -> BlobServiceClient: """Return the BlobServiceClient object.""" conn = self.get_connection(self.conn_id)