Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.61k stars 2.82k forks source link

Set the logging level in azure/core/pipeline/policies/_universal.py to DEBUG #37775

Open Schniemax opened 1 month ago

Schniemax commented 1 month ago

Is your feature request related to a problem? Please describe.

When I retrieve secrets from the keyvault I receive a very long list of GET requests, containing the request URL, the request method, its headers, etc.. Normally I do not need this information in my INFO log, because there is not much value in it. This also means that methods that use a lot of requests that require connections will also flood my logs with connection requests and responses.

Describe the solution you'd like I would like to set the loglevel to DEBUG in policies/_universal.py. This means that the connection request will only be a one liner and still tell me about the success of the operation.

Describe alternatives you've considered The current alternative is, that in each container created I run the command

sed -i 's/logging.INFO/logging.DEBUG/g' /venv/lib/python3.11/site-packages/azure/core/pipeline/policies/_universal.py

That replaces the INFO level in the code with DEBUG manually.

github-actions[bot] commented 1 month ago

@kashifkhan @xiangyan99

github-actions[bot] commented 1 month ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.

xiangyan99 commented 2 weeks ago

@johanste @annatisch @kashifkhan any comments?