diff --git a/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java b/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java index 6aa7404d1..87c8f3124 100644 --- a/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java +++ b/app/src/main/java/com/shayu/phonelive/utils/LogUtils.java @@ -43,7 +43,7 @@ public class LogUtils { if (dir.listFiles() != null) { for (File file : dir.listFiles()) { if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) { - String fileName = file.getName().replace(title, "").replace(".log", ""); + String fileName = file.getName().replace(".log", "").split("_")[1]; if (isDelLog(fileName)) { file.delete(); } diff --git a/common/src/main/java/com/yunbao/common/utils/LogUtil.java b/common/src/main/java/com/yunbao/common/utils/LogUtil.java index 47c4c8ea7..5b2408cb8 100644 --- a/common/src/main/java/com/yunbao/common/utils/LogUtil.java +++ b/common/src/main/java/com/yunbao/common/utils/LogUtil.java @@ -165,7 +165,7 @@ public class LogUtil { WritableByteChannel writableByteChannel = Channels.newChannel(zos); if (dir.listFiles() != null) { for (File file : dir.listFiles()) { - if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) { + if (file.getName().endsWith(".log")) { ZipEntry entry = new ZipEntry(file.getName()); zos.putNextEntry(entry); fis = new FileInputStream(file);