Setting the logger name as requests
or requests.urllib3
did not work for me. I had to specify the exact logger name to change the logging level.
First See which loggers you have defined, to see which ones you want to remove
print(logging.Logger.manager.loggerDict)
And you will see something like this:
{...'urllib3.poolmanager': <logging.Logger object at 0x1070a6e10>, 'django.request': <logging.Logger object at 0x106d61290>, 'django.template': <logging.Logger object at 0x10630dcd0>, 'django.server': <logging.Logger object at 0x106dd6a50>, 'urllib3.connection': <logging.Logger object at 0x10710a350>,'urllib3.connectionpool': <logging.Logger object at 0x106e09690> ...}
Then configure the level for the exact logger:
'loggers': {
'': {
'handlers': ['default'],
'level': 'DEBUG',
'propagate': True
},
'urllib3.connectionpool': {
'handlers': ['default'],
'level': 'WARNING',
'propagate' : False
},