@ApiStatus.Internal
  public static void configureLogFileAndConsole(
    @NotNull Path logFilePath,
    boolean appendToFile,
    boolean enableConsoleLogger,
    boolean showDateInConsole,
    @Nullable Runnable onRotate
  ) {
    long limit = Long.getLong("idea.log.limit", 10_000_000);
    int count = Integer.getInteger("idea.log.count", 12);

    java.util.logging.Logger rootLogger = java.util.logging.Logger.getLogger("");
    IdeaLogRecordFormatter layout = new IdeaLogRecordFormatter();

    Handler fileHandler = new RollingFileHandler(logFilePath, limit, count, appendToFile, onRotate);
    fileHandler.setFormatter(layout);
    fileHandler.setLevel(Level.FINEST);
    rootLogger.addHandler(fileHandler);

    if (enableConsoleLogger) {
      Handler consoleHandler = new OptimizedConsoleHandler();
      consoleHandler.setFormatter(new IdeaLogRecordFormatter(showDateInConsole, layout));
      consoleHandler.setLevel(Level.WARNING);
      rootLogger.addHandler(consoleHandler);
    }
  }
@ApiStatus.Internal
  public static void configureLogFileAndConsole(
    @NotNull Path logFilePath,
    boolean appendToFile,
    boolean enableConsoleLogger,
    boolean showDateInConsole,
    @Nullable Runnable onRotate
  )