I just Started to try django logging module in my project...
I am following django docs for loging all logs from Django’s default logging configuration to a custome log file. I copied the following code to my settings.py
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/project/debug.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
Here I assume that all of my console logs must be written in debug.log
file,
But its not happening.
Can anyone please suggest me whata wrong here or is there any other way to do so?