From bd89ef81fe2c6e4ea39b61367f7d84d6756aafeb Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Tue, 28 Jun 2016 15:16:59 +0000
Subject: [PATCH] OPENDJ-3140 Prevent dsconfig to log on the console

---
 opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java b/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java
index 041c281..98b92a5 100644
--- a/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java
+++ b/opendj-config/src/main/java/org/forgerock/opendj/config/dsconfig/DSConfig.java
@@ -52,6 +52,8 @@
 import java.util.SortedSet;
 import java.util.TreeMap;
 import java.util.TreeSet;
+import java.util.logging.Level;
+import java.util.logging.LogManager;
 import java.util.logging.Logger;
 
 import org.forgerock.i18n.LocalizableMessage;
@@ -785,7 +787,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();
+        disableLogging();
         final DSConfig app = new DSConfig(outStream, errStream);
         app.sessionStartTime = System.currentTimeMillis();
 
@@ -806,8 +808,9 @@
      * 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);
+    private static void disableLogging() {
+        LogManager.getLogManager().reset();
+        Logger.getLogger("").setLevel(Level.OFF);
     }
 
     /** The factory which the application should use to retrieve its management context. */

--
Gitblit v1.10.0