From bce96164c2ad2df12e9f7fb961941ce35ac6185f Mon Sep 17 00:00:00 2001 From: gaoxq <376340421@qq.com> Date: Mon, 2 Feb 2026 22:38:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E6=BA=90?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/jeesite/modules/app/utils/LoggerUtils.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/web-api/src/main/java/com/jeesite/modules/app/utils/LoggerUtils.java b/web-api/src/main/java/com/jeesite/modules/app/utils/LoggerUtils.java index 887b438d..53f724cb 100644 --- a/web-api/src/main/java/com/jeesite/modules/app/utils/LoggerUtils.java +++ b/web-api/src/main/java/com/jeesite/modules/app/utils/LoggerUtils.java @@ -21,8 +21,7 @@ public class LoggerUtils { private String baseLogPath; - // 日期格式(文件名:yyyyMMdd,日志内容时间戳:yyyy-MM-dd HH:mm:ss.SSS) - private final SimpleDateFormat fileDateFormat = new SimpleDateFormat("yyyyMMdd"); + private final SimpleDateFormat logDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); // 线程安全锁 @@ -65,11 +64,8 @@ public class LoggerUtils { } } - /** - * 获取当前日志文件路径(按日期拆分:baseLogPath/log_yyyyMMdd.txt) - */ private String getCurrentLogFilePath(Level level) { - String fileName = level + "_" + fileDateFormat.format(new Date()) + ".log"; + String fileName = level + "_APP" + ".log"; return baseLogPath + File.separator + fileName; } @@ -166,8 +162,7 @@ public class LoggerUtils { } StringBuilder sb = new StringBuilder(); for (Object msg : messages) { - // 任意类型转换为字符串:null转为"null",其他类型调用String.valueOf() - sb.append(String.valueOf(msg)); + sb.append(msg); } return sb.toString(); }