fix: makeNewLogFile() in FileLoggerUtilities appending to the file instead of deleting the existing one

This commit is contained in:
ChomeNS
2024-11-10 08:31:43 +07:00
parent 3811790c93
commit 4f8d5bfff5

View File

@@ -79,7 +79,7 @@ public class FileLoggerUtilities {
public static synchronized void makeNewLogFile() throws IOException {
currentLogDate = LocalDate.now();
logWriter = new OutputStreamWriter(Files.newOutputStream(logPath, StandardOpenOption.CREATE, StandardOpenOption.APPEND), StandardCharsets.UTF_8);
logWriter = new OutputStreamWriter(Files.newOutputStream(logPath, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING), StandardCharsets.UTF_8);
logWriter.write(currentLogDate.toString() + '\n');
logWriter.flush();
}