Skip to content

Commit

Permalink
fix: rotate debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
hantmac committed Sep 18, 2024
1 parent df27b70 commit d2517b9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ private void initializeFileHandler() {
return;
}
try {
System.setProperty("java.util.logging.FileHandler.limit", "524288000"); // 500MB
System.setProperty("java.util.logging.FileHandler.count", "10");
System.setProperty("java.util.logging.FileHandler.limit", "5242880000"); // 5000MB
System.setProperty("java.util.logging.FileHandler.count", "200");
System.setProperty("java.util.logging.FileHandler.append", "true"); // Enable log file reuse
FILE_HANDLER = new FileHandler(file.getAbsolutePath(), true); // Pass 'true' to the FileHandler constructor to enable appending
FILE_HANDLER = new FileHandler(file.getAbsolutePath(), Integer.parseInt(System.getProperty("java.util.logging.FileHandler.limit")),
Integer.parseInt(System.getProperty("java.util.logging.FileHandler.count")), true);
FILE_HANDLER.setLevel(Level.ALL);
FILE_HANDLER.setFormatter(new SimpleFormatter());
logger.addHandler(FILE_HANDLER);
Expand Down

0 comments on commit d2517b9

Please sign in to comment.