refactor: change log archive limit to 500mb and also log to console (probably won't help much if there's a lot of log though)

This commit is contained in:
ChomeNS
2025-04-08 08:11:53 +07:00
parent 37326ede51
commit 50ba4e1c41
2 changed files with 11 additions and 2 deletions

View File

@@ -1,6 +1,8 @@
package me.chayapak1.chomens_bot.util;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import me.chayapak1.chomens_bot.data.logging.LogType;
import net.kyori.adventure.text.Component;
import java.io.BufferedReader;
import java.io.IOException;
@@ -100,7 +102,14 @@ public class FileLoggerUtilities {
}
public static synchronized void compressLogFile () throws IOException {
if (Files.size(logPath) > 100 * 1024 * 1024) { // Will not save because log file is too big
if (Files.size(logPath) > 500 * 1024 * 1024) { // Will not save because log file is too big
LoggerUtilities.log(
LogType.INFO,
null,
Component.text("Not archiving log file since it's too big!"),
false,
true
);
return;
}