From 2155def10e32885ae6f05fa8556bd9099c400f39 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Tue, 01 May 2007 21:47:07 +0000
Subject: [PATCH] This code introduces creation of a log file in the system's temporary directory for detailed log messages that can be used by any of the quicksetup applications (install, uninstall, upgrade). Right now logging if fairly meager but we should work on this soon. This work is being done in anticipation of changes that Brian has suggested in reducing the verbosity of the quicksetup applications. The idea is to put the details in the file and omit the messages in the progress panel details area (for instance messages about moving files around).
---
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java | 29 +++++++++++++++++++++++++++--
1 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index 5aef1df..bf2b4ac 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -227,6 +227,15 @@
* Creates a default instance.
*/
public Upgrader() {
+ try {
+ if (!QuickSetupLog.isInitialized())
+ QuickSetupLog.initLogFileHandler(
+ File.createTempFile(
+ UpgradeLauncher.LOG_FILE_PREFIX,
+ UpgradeLauncher.LOG_FILE_SUFFIX));
+ } catch (IOException e) {
+ System.err.println("Failed to initialize log");
+ }
if (Utils.isWebStart()) {
initLoader();
}
@@ -615,7 +624,17 @@
Utils.getPath(buildZip), null);
}
}
- getRemoteBuildManager().download(buildToDownload, buildZip);
+ LOG.log(Level.FINE, "Preparing to download " +
+ buildToDownload.getUrl() +
+ " to " + Utils.getPath(buildZip));
+ try {
+ getRemoteBuildManager().download(buildToDownload, buildZip);
+ } catch (IOException e) {
+ throw new ApplicationException(
+ ApplicationException.Type.APPLICATION,
+ "Failed to download build package .zip " +
+ "file from " + buildToDownload.getUrl(), e);
+ }
notifyListeners(formatter.getFormattedDone() +
formatter.getLineBreak());
} catch (ApplicationException e) {
@@ -812,6 +831,8 @@
if (runException == null) {
if (!Utils.isCli()) {
+ notifyListenersOfLog();
+
// This seems to be the preferred way to print
// a message to the top of the progress panel without
// having it show up in the Details section which we
@@ -831,6 +852,8 @@
} else {
if (!Utils.isCli()) {
notifyListeners(formatter.getFormattedError(runException, true));
+ notifyListenersOfLog();
+ notifyListeners(null);
setCurrentProgressStep(UpgradeProgressStep.FINISHED_WITH_ERRORS);
} else {
runException.printStackTrace();
@@ -865,7 +888,9 @@
control.stopServer();
} catch (Exception e) {
throw new ApplicationException(ApplicationException.Type.APPLICATION,
- "Server health check failed", e);
+ "Server health check failed. Make sure the server is capable " +
+ "of starting without errors before running the upgrade " +
+ "tool.", e);
}
}
--
Gitblit v1.10.0