Django: how to set log level to INFO or DEBUG
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Dreaming in Puzzles
--
Chapters
00:00 Django: How To Set Log Level To Info Or Debug
01:14 Accepted Answer Score 17
01:53 Answer 2 Score 6
02:19 Answer 3 Score 2
02:32 Thank you
--
Full question
https://stackoverflow.com/questions/1972...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #logging #configurationfiles
#avk47
    Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Dreaming in Puzzles
--
Chapters
00:00 Django: How To Set Log Level To Info Or Debug
01:14 Accepted Answer Score 17
01:53 Answer 2 Score 6
02:19 Answer 3 Score 2
02:32 Thank you
--
Full question
https://stackoverflow.com/questions/1972...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #logging #configurationfiles
#avk47
ACCEPTED ANSWER
Score 17
You need to add e.g.
'core.handlers': {
    'level': 'DEBUG',
    'handlers': ['console']
}
in parallel with the django.request entry, or
'root': {
    'level': 'DEBUG',
    'handlers': ['console']
}
in parallel with the 'loggers' entry. This will ensure that the level is set on the logger you are actually using, rather than just the django.request logger.
Update: To show messages for all your modules, just add entries alongside django.request to include your top level modules, e.g. api, handlers, core or whatever. Since you haven't said exactly what your package/module hierarchy is, I can't be more specific.
ANSWER 2
Score 6
I fixed it by changing
LOGGING = {
    ...
}
to:
logging.config.dictConfig({
    ...
})
For example to log all messages to the console:
import logging.config
LOGGING_CONFIG = None
logging.config.dictConfig({
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'console': {
            # exact format is not important, this is the minimum information
            'format': '%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
        },
    },
    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'formatter': 'console',
        },
    },
    'loggers': {
    # root logger
        '': {
            'level': 'DEBUG',
            'handlers': ['console'],
        },
    },
})
ANSWER 3
Score 2
I guess, this is a minimum configuration with settings.py to change log level with root logger.
LOGGING = {
    "version": 1,
    'disable_existing_loggers': False,
    "root": {
        "level": "INFO"
    }
}