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/UpgradeLauncher.java |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
index abd55ed..79b4d1c 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
@@ -30,14 +30,27 @@
 import org.opends.quicksetup.Launcher;
 import org.opends.quicksetup.CliApplication;
 import org.opends.quicksetup.Installation;
+import org.opends.quicksetup.QuickSetupLog;
 import org.opends.quicksetup.util.Utils;
 
+import java.util.logging.Logger;
+import java.io.File;
+
 /**
  * This class is called by the upgrade and upgrade.bat
  * command line utilities to launch an upgrade process.
  */
 public class UpgradeLauncher extends Launcher {
 
+  /** Prefix for log files. */
+  static public final String LOG_FILE_PREFIX = "opends-upgrade-";
+
+  /** Suffix for log files. */
+  static public final String LOG_FILE_SUFFIX = ".log";
+
+  static private final Logger LOG =
+          Logger.getLogger(UpgradeLauncher.class.getName());
+
   /**
    * The main method which is called by the setup command lines.
    *
@@ -46,6 +59,13 @@
    * will pass to the org.opends.server.tools.InstallDS class.
    */
   public static void main(String[] args) {
+    try {
+      QuickSetupLog.initLogFileHandler(
+              File.createTempFile(LOG_FILE_PREFIX, LOG_FILE_SUFFIX));
+    } catch (Throwable t) {
+      System.err.println("Unable to initialize log");
+      t.printStackTrace();
+    }
     new UpgradeLauncher(args).launch();
   }
 

--
Gitblit v1.10.0