修改数据源配置
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user