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

lutoff
17.21.2009 0fd90c090279ef6219681098df77d0ec8cb0c5cf
Fix for issue #3797 (OpenDS should log it's instance path at startup.)
Two new msgs are added. These msg are printed out
* when the server is started:
* by "start-ds -s"

Commited with QA and Doc approvals
2 files modified
66 ■■■■■ changed files
opends/src/messages/messages/runtime_information.properties 7 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/RuntimeInformation.java 59 ●●●●● patch | view | raw | blame | history
opends/src/messages/messages/runtime_information.properties
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
#      Copyright 2006-2008 Sun Microsystems, Inc.
#      Copyright 2006-2009 Sun Microsystems, Inc.
@@ -73,4 +73,9 @@
NOTICE_JVM_HOST_WITH_UNKNOWN_PHYSICAL_MEM_20=JVM Host: %s, running %s, \
                   unknown physical memory size, \
                   number of processors available %d
NOTICE_INSTALL_DIRECTORY_21=Installation Directory:  %s
NOTICE_UNKNOWN_INSTALL_DIRECTORY_22=Installation Directory:  unknown
NOTICE_INSTANCE_DIRECTORY_23=Instance Directory:      %s
NOTICE_UNKNOWN_INSTANCE_DIRECTORY_24=Instance Directory:      unknown
opends/src/server/org/opends/server/util/RuntimeInformation.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
 package org.opends.server.util;
@@ -32,6 +32,7 @@
 import static org.opends.server.util.DynamicConstants.*;
 import org.opends.server.core.DirectoryServer;
 import java.net.InetAddress;
import java.io.File;
 import java.lang.management.RuntimeMXBean;
 import java.lang.management.ManagementFactory;
 import java.util.List;
@@ -123,6 +124,34 @@
             NOTE_JE_VERSION.get(JEVersion.CURRENT_VERSION.toString()));
     System.out.println(
             NOTE_CURRENT_DIRECTORY.get(System.getProperty("user.dir")));
     String installDir = DirectoryServer.getServerRoot();
     try
     {
       installDir = new File(installDir).getCanonicalPath();
     }
     catch (Exception e){}
     if (installDir == null)
     {
       System.out.println(NOTE_UNKNOWN_INSTALL_DIRECTORY.get());
     }
     else
     {
       System.out.println(NOTE_INSTALL_DIRECTORY.get(installDir));
     }
     String instanceDir = DirectoryServer.getInstanceRoot();
     try
     {
       instanceDir = new File(instanceDir).getCanonicalPath();
     }
     catch (Exception e){}
     if (instanceDir == null)
     {
       System.out.println(NOTE_UNKNOWN_INSTANCE_DIRECTORY.get());
     }
     else
     {
       System.out.println(NOTE_INSTANCE_DIRECTORY.get(instanceDir));
     }
     System.out.println(
             NOTE_OPERATING_SYSTEM.get(System.getProperty("os.name") + " " +
                     System.getProperty("os.version") + " " +
@@ -234,6 +263,34 @@
    * Write runtime information to error log.
    */
   public static void logInfo() {
     String installDir = DirectoryServer.getServerRoot();
     try
     {
       installDir = new File(installDir).getCanonicalPath();
     }
     catch (Exception e){}
     if (installDir == null)
     {
       logError(NOTE_UNKNOWN_INSTALL_DIRECTORY.get());
     }
     else
     {
       logError(NOTE_INSTALL_DIRECTORY.get(installDir));
     }
     String instanceDir = DirectoryServer.getInstanceRoot();
     try
     {
       instanceDir = new File(instanceDir).getCanonicalPath();
     }
     catch (Exception e){}
     if (instanceDir == null)
     {
       logError(NOTE_UNKNOWN_INSTANCE_DIRECTORY.get());
     }
     else
     {
       logError(NOTE_INSTANCE_DIRECTORY.get(instanceDir));
     }
    logError(NOTE_JVM_INFO.get(System.getProperty("java.runtime.version"),
                               System.getProperty("java.vendor"),
                               getArch(),Runtime.getRuntime().maxMemory()));