Hello @Pandey, Yogesh ,
We don't currently have any kind of dynamic way to turn it on or off directly within the client, it's purely based on logging configuration.
Somewhere in the application a line that is something like: logging.basicConfig(level=logging.INFO)
You need to remove that line.
Try to avoid the below log levels if already used (DEBUG, INFO, WARNING, or ERROR):
import logging
logging.basicConfig(level=logging.INFO)
or, for an individual component:
import logging
logging.getLogger("azure.iot.device").setLevel(level=logging.DEBUG)
Additional readings: Register a log stream handler
Github related issues: https://github.com/Azure/azure-iot-sdk-python/issues/382#issuecomment-558221236
Please comment in the below section to get more help in this matter, happy to help.
Please accept the helpful response as 'Answer', which will be helpful to others as well with similar questions