Hi,
I encountered a django logging problem which can not be solved for several hours. My django logging setting is:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'standard': {
'format': '[%(asctime)s - %(name)s - %(levelname)s - %(filename)s:%(lineno)d] %(message)s'
},
},
'handlers': {
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
'file': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': '%s/logs/django.log' % (BASE_DIR),
'maxBytes': 1024 * 1024 * 5,
'backupCount': 5,
'formatter': 'standard',
},
},
'loggers': {
'django': {
'handlers': ['file', 'console'],
'propagate': True,
'level': 'DEBUG',
},
},
}
and in a .py file which django calls, i write:
logger = logging.getLogger('project.xxx.util')
I deploy django with nginx using uwsgi. When I started django, the log file can be created successfully, but no logs will be written to file when executing the py file.
Did anyone have encountered the same problem? Thanks.