I use TimedRotatingFileHandler to logging Django log and rotate every day, but check the log file, strange issue is yesterday log is truncated and logging few today's log, yesterday log is lost!
Django 1.4
uwsgi 1.4.9
Python 2.6
I start 8 django instance with uwsgi. The setting.py is
'handlers': {
'apilog': {
'level': 'INFO',
'class': 'logging.handlers.TimedRotatingFileHandler',
'filename': os.path.join(APILOG, "apilog.log" ),
'when': 'midnight',
'formatter': 'info',
'interval': 1,
'backupCount': 0,
},
},
'loggers': {
'apilog': {
'handlers': ['apilog'],
'level': 'INFO',
'propagate': True
},
}
Did I miss something? Why old logging is lost?