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

Gaetan Boismal
20.38.2016 71695c2e99143ed6821b4ba50f898567c440750f
OPENDJ-3140 Prevent tools to be verbose

Prevent status, dsconfig and dsreplication to log messages in the
console.
3 files modified
14 ■■■■■ changed files
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java 10 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliMain.java 2 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java 2 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java
@@ -52,6 +52,7 @@
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.logging.Logger;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.LocalizableMessageDescriptor.Arg1;
@@ -784,6 +785,7 @@
     * @return Zero to indicate that the program completed successfully, or non-zero to indicate that an error occurred.
     */
    public static int main(String[] args, OutputStream outStream, OutputStream errStream) {
        disableConfigurationFrameworkConsoleLogging();
        final DSConfig app = new DSConfig(outStream, errStream);
        app.sessionStartTime = System.currentTimeMillis();
@@ -800,6 +802,14 @@
        return app.run(args);
    }
    /**
     * Prevent configuration framework to log on the console.
     * @see OPENDJ-3140 for more details.
     */
    private static void disableConfigurationFrameworkConsoleLogging() {
        Logger.getLogger("com.forgerock.opendj.ldap.config.config").setUseParentHandlers(false);
    }
    /** The factory which the application should use to retrieve its management context. */
    private LDAPManagementContextFactory factory;
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliMain.java
@@ -132,6 +132,7 @@
import org.opends.quicksetup.installer.PeerNotFoundException;
import org.opends.quicksetup.util.PlainTextProgressMessageFormatter;
import org.opends.server.core.DirectoryServer;
import org.opends.server.loggers.JDKLogging;
import org.opends.server.tasks.PurgeConflictsHistoricalTask;
import org.opends.server.tools.dsreplication.EnableReplicationUserData.EnableReplicationServerData;
import org.opends.server.tools.dsreplication.ReplicationCliArgumentParser.ServerArgs;
@@ -357,6 +358,7 @@
  {
    PrintStream out = NullOutputStream.wrapOrNullStream(outStream);
    PrintStream err = NullOutputStream.wrapOrNullStream(errStream);
    JDKLogging.disableLogging();
    try
    {
opendj-server-legacy/src/main/java/org/opends/server/tools/status/StatusCli.java
@@ -76,6 +76,7 @@
import org.opends.guitools.controlpanel.util.ControlPanelLog;
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.server.admin.client.cli.SecureConnectionCliArgs;
import org.opends.server.loggers.JDKLogging;
import org.opends.server.types.InitializationException;
import org.opends.server.types.NullOutputStream;
import org.opends.server.util.BuildVersion;
@@ -162,6 +163,7 @@
  {
    PrintStream out = NullOutputStream.wrapOrNullStream(outStream);
    PrintStream err = NullOutputStream.wrapOrNullStream(errStream);
    JDKLogging.disableLogging();
    try {
      ControlPanelLog.initLogFileHandler(