فهرست منبع

feat: 日志添加backupCount

SongZihuan 2 سال پیش
والد
کامیت
1b77893911
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      app/app.py

+ 1 - 1
app/app.py

@@ -26,7 +26,7 @@ class HEnglishFlask(Flask):
                 log_file_name = os.path.join(configure.conf["LOG_HOME"], f"flask-{os.getpid()}.log")
             else:
                 log_file_name = os.path.join(configure.conf["LOG_HOME"], "flask.log")
-            handle = logging.handlers.TimedRotatingFileHandler(log_file_name)
+            handle = logging.handlers.TimedRotatingFileHandler(log_file_name, backupCount=10)
             handle.setFormatter(logging.Formatter("%(levelname)s:%(name)s:%(asctime)s "
                                                   "(%(filename)s:%(lineno)d %(funcName)s) "
                                                   "%(process)d %(thread)d "