Python loggine default level is warning
The default logging level is warning. Since you haven't changed the level, the root logger's level is still warning. That means that it will ignore any logging with a level that is lower than warning, including debug loggings.
This is explained in the tutorial:
import logging
logging.warning('Watch out!') # will print a message to the console
logging.info('I told you so') # will not print anything
https://stackoverflow.com/questions/7016056/python-logging-not-outputting-anything
Code Sample
import sys
import logging
DEBUG = False
# Logging
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'root': {
'handlers': ['console'],
'level': 'DEBUG' if DEBUG else 'INFO',
},
'handlers': {
'console': {
'level': 'DEBUG' if DEBUG else 'INFO',
'class': 'logging.StreamHandler',
'formatter': 'default',
'stream': sys.stderr,
}
},
'loggers': {
'urllib3': {
'level': 'INFO',
},
'urllib3.connectionpool': {
'level': 'DEBUG' if DEBUG else 'INFO',
},
},
'formatters': {
'default': {
'format': '%(asctime)s %(levelname)-2s %(name)s.%(funcName)s:%(lineno)-5d %(message)s', # NOQA
},
},
}
# Setup logging
logging.config.dictConfig(LOGGING)