public static File getLogNameForOldMainLog(final File log, final boolean useOldFile) {
    // this is just searching for the existing logfile name we need to search for meta log file name
    RollingFileHandler rollingFileHandler = new MainWithChildrenRollingFileHandler();
    File dir = rollingFileHandler.getParentFile(log.getAbsoluteFile());
    int previousMainId = rollingFileHandler.calcNextMainId(dir, true);
    if (useOldFile) {
      if (previousMainId > 0) {
        previousMainId--;
      }
    }
    if (previousMainId == 0) {
      previousMainId = 1;
    }

    int childId = rollingFileHandler.calcNextChildId(log, previousMainId > 0 ? previousMainId : 0);
    StringBuilder sb = new StringBuilder(log.getPath());
    int insertIdx = sb.lastIndexOf(".");
    if (insertIdx == -1) {
      sb.append(rollingFileHandler.formatId(previousMainId))
          .append(rollingFileHandler.formatId(childId));
    } else {
      sb.insert(insertIdx, rollingFileHandler.formatId(childId));
      sb.insert(insertIdx, rollingFileHandler.formatId(previousMainId));
    }
    return new File(sb.toString());
  }
notification from manager that the output file is being closed
geode-core/src/main/java/org/apache/geode/internal/logging/ManagerLogWriter.java