|
|
|
@ -330,7 +330,7 @@ public class DailyRollingFileAppender extends FileAppender {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
File file = new File(fileName); |
|
|
|
|
boolean result = false; |
|
|
|
|
boolean isGzipSuccess = false; |
|
|
|
|
|
|
|
|
|
try (FileInputStream fis = new FileInputStream(file); |
|
|
|
|
FileOutputStream fos = new FileOutputStream(target); |
|
|
|
@ -341,14 +341,14 @@ public class DailyRollingFileAppender extends FileAppender {
|
|
|
|
|
while ((n = fis.read(inbuf)) != -1) { |
|
|
|
|
gzos.write(inbuf, 0, n); |
|
|
|
|
} |
|
|
|
|
result = true; |
|
|
|
|
isGzipSuccess = true; |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
LogLog.error("Compress " + fileName + " to " + scheduledFilename + " failed."); |
|
|
|
|
LogLog.error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
boolean isDeleteSuccess = true; |
|
|
|
|
if (result) { |
|
|
|
|
if (isGzipSuccess) { |
|
|
|
|
isDeleteSuccess = file.delete(); |
|
|
|
|
LogLog.debug(fileName + " -> " + scheduledFilename); |
|
|
|
|
} else { |
|
|
|
|