private static void initLogger() throws IOException {
    System.setProperty("java.util.logging.config.class", Object.class.getName());

    String dirPath = System.getProperty("idea.updater.log", System.getProperty("java.io.tmpdir", System.getProperty("user.home", ".")));
    Path logDir = Path.of(dirPath).toAbsolutePath().normalize();
    logPath = logDir.resolve(LOG_FILE_NAME).toString();
    String errorLogPath = logDir.resolve(ERROR_LOG_FILE_NAME).toString();

    Formatter formatter = new Formatter() {
      @Override
      public String format(LogRecord record) {
        Level level = record.getLevel();
        String levelName = level == Level.SEVERE ? "ERROR" : level == Level.WARNING ? "WARN" : "INFO";

        String className = record.getSourceClassName();
        if (className != null) {
          className = className.substring(className.lastIndexOf('.') + 1);
        }

        String stacktrace = "";
        if (record.getThrown() != null) {
          StringWriter writer = new StringWriter().append(System.lineSeparator());
          record.getThrown().printStackTrace(new PrintWriter(writer));
          stacktrace = writer.getBuffer().toString();
        }

        return String.format("%1$td/%1$tm %1$tH:%1$tM:%1$tS %2$-5s %3$s.%4$s - %5$s%6$s%n",
                             record.getMillis(), levelName, className, record.getSourceMethodName(), record.getMessage(), stacktrace);
      }
    };

    var cumulativeLog = new FileHandler(logPath, 0L, 1, true);
    cumulativeLog.setEncoding("UTF-8");
    cumulativeLog.setLevel(Level.ALL);
    cumulativeLog.setFormatter(formatter);

    var errorLog = new FileHandler(errorLogPath, 0L, 1, false);
    cumulativeLog.setEncoding("UTF-8");
    errorLog.setLevel(Level.SEVERE);
    errorLog.setFormatter(formatter);

    LOG.addHandler(cumulativeLog);
    LOG.addHandler(errorLog);
    LOG.setLevel(Level.ALL);
    LOG.info("--- Updater started ---");
  }
private static void initLogger()