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

jvergara
30.10.2009 d8ce3d477f4ba47e1e8095136da6e301663c0f31
Remove the previously added logger for DSConfig and remove some debug messages that were displayed systematically.
3 files modified
79 ■■■■■ changed files
opends/src/ads/org/opends/admin/ads/util/ApplicationKeyManager.java 2 ●●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/util/ApplicationTrustManager.java 2 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java 75 ●●●●● patch | view | raw | blame | history
opends/src/ads/org/opends/admin/ads/util/ApplicationKeyManager.java
@@ -79,8 +79,6 @@
      System.getProperty("org.opends.admin.keymanageralgo");
    String userSpecifiedProvider =
      System.getProperty("org.opends.admin.keymanagerprovider");
    LOG.log(Level.INFO, "User specified algo: "+userSpecifiedAlgo);
    LOG.log(Level.INFO, "User specified provider: "+userSpecifiedProvider);
    // Have some fallbacks to choose the provider and algorith of the key
    // manager.  First see if the user wanted to use something specific,
opends/src/ads/org/opends/admin/ads/util/ApplicationTrustManager.java
@@ -107,8 +107,6 @@
      System.getProperty("org.opends.admin.trustmanageralgo");
    String userSpecifiedProvider =
      System.getProperty("org.opends.admin.trustmanagerprovider");
    LOG.log(Level.INFO, "User specified algo: "+userSpecifiedAlgo);
    LOG.log(Level.INFO, "User specified provider: "+userSpecifiedProvider);
    // Have some fallbacks to choose the provider and algorith of the key
    // manager.  First see if the user wanted to use something specific,
opends/src/server/org/opends/server/tools/dsconfig/DSConfig.java
@@ -48,9 +48,6 @@
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.logging.FileHandler;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
import org.opends.messages.Message;
import org.opends.quicksetup.util.Utils;
@@ -93,12 +90,6 @@
 */
public final class DSConfig extends ConsoleApplication {
  /** Prefix for log files. */
  static public final String LOG_FILE_PREFIX = "dsconfig";
  /** Suffix for log files. */
  static public final String LOG_FILE_SUFFIX = ".log";
  /**
   * A menu call-back which runs a sub-command interactively.
   */
@@ -353,13 +344,6 @@
        return 1;
      }
    }
    try {
      DSConfigLog.initLogFileHandler(
          File.createTempFile(LOG_FILE_PREFIX, LOG_FILE_SUFFIX));
    } catch (Throwable t) {
      System.err.println("Unable to initialize log");
      t.printStackTrace();
    }
    // Run the application.
    return app.run(args);
@@ -1144,62 +1128,3 @@
    }
  }
}
/**
 * Utilities for setting up DSConfig application log. This is required since
 * DSConfig is using classes (such as ApplicationTrustManager) than can log
 * messages.
 */
class DSConfigLog
{
  private static String[] packages = {
    "org.opends"
  };
  static private File logFile = null;
  static private FileHandler fileHandler;
  /**
   * Creates a new file handler for writing log messages to the file indicated
   * by <code>file</code>.
   * @param file log file to which log messages will be written
   * @throws IOException if something goes wrong
   */
  static public void initLogFileHandler(File file) throws IOException {
    if (!isInitialized())
    {
      logFile = file;
      fileHandler = new FileHandler(logFile.getCanonicalPath());
      fileHandler.setFormatter(new SimpleFormatter());
      for (String packageName : packages)
      {
        Logger logger = Logger.getLogger(packageName);
        logger.setUseParentHandlers(false); // disable logging to console
        logger.addHandler(fileHandler);
      }
    }
  }
  /**
   * Writes messages under a given package in the file handler defined when
   * calling initLogFileHandler.  Note that initLogFileHandler should be called
   * before calling this method.
   * @param packageName the package name.
   * @throws IOException if something goes wrong
   */
  static public void initPackage(String packageName) throws IOException {
    Logger logger = Logger.getLogger(packageName);
    logger.setUseParentHandlers(false); // disable logging to console
    logger.addHandler(fileHandler);
  }
  /**
   * Indicates whether or not the log file has been initialized.
   * @return true when the log file has been initialized
   */
  static private boolean isInitialized() {
    return logFile != null;
  }
}