mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Ludovic Poitou
24.59.2015 058d8b904cb8a1b27b2d5f0202059b6b8fcb98e9
OPENDJ-2463 - Provide a method in UpgradeLog class to retrieve the path, and use it instead of constructing it.
2 files modified
24 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java 7 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeLog.java 17 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/Upgrade.java
@@ -626,9 +626,7 @@
    context.notify(
        INFO_UPGRADE_SUMMARY.get(context.getFromVersion(), context.getToVersion()),
        NOTICE_CALLBACK);
    context.notify(INFO_UPGRADE_GENERAL_SEE_FOR_DETAILS.get(UpgradeUtils
        .getInstallationPath()
        + File.separator + UpgradeLog.UPGRADELOGNAME), NOTICE_CALLBACK);
    context.notify(INFO_UPGRADE_GENERAL_SEE_FOR_DETAILS.get(UpgradeLog.getLogFilePath()), NOTICE_CALLBACK);
    // Checks License.
    checkLicence(context);
@@ -716,8 +714,7 @@
    }
    finally
    {
      context.notify(INFO_UPGRADE_GENERAL_SEE_FOR_DETAILS.get(UpgradeUtils.getInstallationPath()
          + File.separator + UpgradeLog.UPGRADELOGNAME), NOTICE_CALLBACK);
      context.notify(INFO_UPGRADE_GENERAL_SEE_FOR_DETAILS.get(UpgradeLog.getLogFilePath()), NOTICE_CALLBACK);
      logger.info(INFO_UPGRADE_PROCESS_END);
    }
  }
opendj-server-legacy/src/main/java/org/opends/server/tools/upgrade/UpgradeLog.java
@@ -69,7 +69,8 @@
    if (logFile == null)
    {
      logFile = new File(UpgradeUtils.getInstancePath() + File.separator + LOGDIR + File.separator + UPGRADELOGNAME);
      logFile = new File(UpgradeUtils.getInstancePath() + File.separator + Installation.LOGS_PATH_RELATIVE
          + File.separator + UPGRADELOGNAME);
    }
    try
    {
@@ -86,7 +87,7 @@
      public String format(LogRecord record)
      {
        // Format the log ~like the errors logger.
        StringBuffer sb = new StringBuffer();
        StringBuilder sb = new StringBuilder();
        final SimpleDateFormat dateFormat =
            new SimpleDateFormat("[dd/MMM/yyyy:HH:mm:ss Z]");
        sb.append(dateFormat.format(record.getMillis())).append(SPACE);
@@ -131,4 +132,16 @@
          .getMessage()));
    }
  }
  static String getLogFilePath()
  {
    try
    {
      return logFile.getCanonicalPath();
    }
    catch (IOException e)
    {
      return logFile.getPath();
    }
  }
}