Skip to content

Commit

Permalink
Merge pull request #271 from datafuselabs/fix/rotate-debug-log
Browse files Browse the repository at this point in the history
fix: rotate debug log
  • Loading branch information
hantmac authored Sep 18, 2024
2 parents df27b70 + d2517b9 commit 4c0314f
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 4c0314f

Please sign in to comment.