调整日志收集
This commit is contained in:
parent
8455c360fc
commit
e52ec4a2b8
@ -43,7 +43,7 @@ public class LogUtils {
|
|||||||
if (dir.listFiles() != null) {
|
if (dir.listFiles() != null) {
|
||||||
for (File file : dir.listFiles()) {
|
for (File file : dir.listFiles()) {
|
||||||
if (file.getName().endsWith(".log") && !"error.log".equals(file.getName())) {
|
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)) {
|
if (isDelLog(fileName)) {
|
||||||
file.delete();
|
file.delete();
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ public class LogUtil {
|
|||||||
WritableByteChannel writableByteChannel = Channels.newChannel(zos);
|
WritableByteChannel writableByteChannel = Channels.newChannel(zos);
|
||||||
if (dir.listFiles() != null) {
|
if (dir.listFiles() != null) {
|
||||||
for (File file : dir.listFiles()) {
|
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());
|
ZipEntry entry = new ZipEntry(file.getName());
|
||||||
zos.putNextEntry(entry);
|
zos.putNextEntry(entry);
|
||||||
fis = new FileInputStream(file);
|
fis = new FileInputStream(file);
|
||||||
|
Loading…
Reference in New Issue
Block a user