Describe the bug
It's unclear to me how I can disable the default HTTP logging policy. Is this documented somewhere?
Hi @Korijn
This logger respects the logging protocol of Python, and the logger itself is named azure.core.pipeline.policies.http_logging_policy. You can change the level of this level to WARNING for instance.
Ok, thanks! I ended up setting logger.disable = True on that logger to avoid a little more overhead
Hello everyone,
Certainly, setting the logger level to WARNING solves the problem:
logger = logging.getLogger("azure.core.pipeline.policies.http_logging_policy")
logger.setLevel(logging.WARNING)
However, it seems that Cosmos DB client does not respect logging_enable constructor parameter mentioned in the documentation:
https://docs.microsoft.com/en-us/python/api/overview/azure/cosmos-readme?view=azure-python#logging
It is not possible to disable logging by setting it to False:
# doesn't work
client = CosmosClient(url, credential=key, logging_enable=False)
I'm using azure-cosmos 4.2.0.
Thanks for your support.
Sergey
Most helpful comment
Hi @Korijn
This logger respects the logging protocol of Python, and the logger itself is named
azure.core.pipeline.policies.http_logging_policy. You can change the level of this level to WARNING for instance.Reference:
https://docs.python.org/3.8/library/logging.html