'default': { 'level':'DEBUG', 'class':'logging.handlers.RotatingFileHandler', 'filename': os.path.join(DIRNAME+'/logs/','bingchuan.log'), 'maxBytes': 1024 * 1024 * 5, # 5 MB 'encoding': 'utf8', 'backupCount': 5, #表示生成几个 'formatter':'standard', },
'default': { 'level':'DEBUG', 'class':'logging.handlers.TimedRotatingFileHandler', 'filename': os.path.join(DIRNAME+'/logs/','bingchuan.log'), 'when':'MIDNIGHT', ## S - Seconds # M - Minutes # H - Hours # D - Days 注意配置为D可能会产生隔天服务重启未生成新log的问题,应该使用MIDNIGTH # MIDNIGHT - roll over at midnight 需注意与D的区别 # W{0-6} - roll over on a certain day; 0 - Monday 'backupCount': 7, 'encoding': 'utf8', 'interval' : 1, 'formatter':'standard', },