2👍
✅
Your problem is in the filename, You need to set it to the right path!
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': os.path.join(BASE_DIR,'APPNAME.log'),
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
2👍
Replace with a static route and do not forget to give the file permission.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/home/user/proyect/debug.log,
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
- [Django]-What is the difference between SlugField() vs CharField() in Django models
- [Django]-Can you show me an example of Mixins with class-based views in Django? What is the usage?
- [Django]-See if node exists before creating in NeoModel
- [Django]-What is the best system to run django on?
1👍
It is probably because you have no logs for django
handler.
Define one with empty string as a default one:
...
'loggers': {
'': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
...
The ‘django’ logger is used in django only once – in the library itself.
When creating a logger you give it a name – usually something like this: log = logging.getLogger(__name__)
– where a name is the name of the module which it will be used in.
You can specify and configure different modules to write/report in a different way.
- [Django]-Archiving Django models
- [Django]-How to get penultimate item from QuerySet in Django?
- [Django]-Build When Case query in for loop django
- [Django]-Django Quill Editor Display Saved Field
- [Django]-Python and Oracle
Source:stackexchange.com