Skip to content

Commit

Permalink
Set default wasb Azure http logging level to warning; fixes #16224 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
havocbane authored Aug 9, 2022
1 parent 85137f3 commit d5f40d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions airflow/providers/microsoft/azure/hooks/wasb.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"""

import logging
import os
from typing import Any, Dict, List, Optional

from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit d5f40d7

Please sign in to comment.