Commit bf5cad37 authored by Allvey's avatar Allvey

修正日志路径

parents 32ce81a7 229caa7f
...@@ -27,8 +27,8 @@ import time ...@@ -27,8 +27,8 @@ import time
log_path = "/usr/local/fleet-log/dispatch" log_path = "/usr/local/fleet-log/dispatch"
# 创建日志目录 # 创建日志目录
# if not os.path.exists(log_path): if not os.path.exists(log_path):
# os.mkdir(log_path) os.mkdir(log_path)
# logging初始化工作 # logging初始化工作
logging.basicConfig() logging.basicConfig()
...@@ -38,8 +38,8 @@ logger.setLevel(logging.INFO) ...@@ -38,8 +38,8 @@ logger.setLevel(logging.INFO)
# timefilehandler = logging.handlers.TimedRotatingFileHandler(log_path + "/dispatch.log", when='M', interval=1, backupCount=60) # timefilehandler = logging.handlers.TimedRotatingFileHandler(log_path + "/dispatch.log", when='M', interval=1, backupCount=60)
# filehandler = logging.handlers.RotatingFileHandler(log_path + "/dispatch.log", maxBytes=3*1024*1024, backupCount=10) filehandler = logging.handlers.RotatingFileHandler(log_path + "/dispatch.log", maxBytes=3*1024*1024, backupCount=10)
filehandler = logging.handlers.RotatingFileHandler("./Logs/dispatch.log", maxBytes=3 * 1024 * 1024, backupCount=10) # filehandler = logging.handlers.RotatingFileHandler("./Logs/dispatch.log", maxBytes=3 * 1024 * 1024, backupCount=10)
# 设置后缀名称,跟strftime的格式一样 # 设置后缀名称,跟strftime的格式一样
filehandler.suffix = "%Y-%m-%d_%H-%M.log" filehandler.suffix = "%Y-%m-%d_%H-%M.log"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment