[Answered ]-No handlers could be found for logger requests.packages.urllib3.connectionpool

2👍

You are using the handlers wrongly in the settings.py file.
You should specify the package that you want log in the loggers child of the LOGGING dictionary.

Try something like this:

LOGGING = {
    "formatters": {
        "verbose": {
            "format": "%(asctime)s %(levelname)s:%(name)s:L%(lineno)s: %(message)s"
        }
    },
    "handlers": {
        "console": {
            "level": "DEBUG",
            "formatter": "verbose",
            "class": "logging.StreamHandler",
        },
    },
    "loggers": {
        "requests": {
            "handlers": ["console"],
            "level": "DEBUG",
            "propagate": True,
        },
        "requests.packages.urllib3.connectionpool": {
            "handlers": ["console"],
            "level": "DEBUG",
            "propagate": True,
        },
    }
👤KGs

Leave a comment