|
|
|
@ -1,11 +1,17 @@
|
|
|
|
|
package org.springblade.common.utils; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.lang.UUID; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
import org.springblade.common.constant.CommonConstant; |
|
|
|
|
|
|
|
|
|
import java.io.*; |
|
|
|
|
import java.io.BufferedReader; |
|
|
|
|
import java.io.File; |
|
|
|
|
import java.io.FileWriter; |
|
|
|
|
import java.io.IOException; |
|
|
|
|
import java.io.InputStreamReader; |
|
|
|
|
import java.io.Writer; |
|
|
|
|
import java.net.HttpURLConnection; |
|
|
|
|
import java.net.URL; |
|
|
|
|
import java.util.Calendar; |
|
|
|
@ -38,7 +44,8 @@ public class FileLogsUtil {
|
|
|
|
|
imgPathFile.mkdirs(); |
|
|
|
|
} |
|
|
|
|
// 按照年-月-日 创建一个字符串
|
|
|
|
|
String fileName = System.currentTimeMillis() + ".log"; |
|
|
|
|
// 使用 uuid 作为文件名 确保文件唯一
|
|
|
|
|
String fileName = UUID.randomUUID().toString() + ".log"; |
|
|
|
|
|
|
|
|
|
Writer writer = null; |
|
|
|
|
try { |
|
|
|
|