Explorar o código

Disabled java util logging altogether.

From what I've tried and what I've read, it seems you can't reliably change the log level for loggers programmatically.  You can kind of get it to work, but then you see unexpected behavior.  I've seen many posts recommend disabling java util logging, or using one of the many bridges (such as the slf4j bridge) to replace the functionality provided by java.util.logging.
James Albright %!s(int64=9) %!d(string=hai) anos
pai
achega
4d6ca2870d

+ 4 - 3
src/main/java/password/pwm/util/logging/PwmLogManager.java

@@ -23,8 +23,10 @@
 package password.pwm.util.logging;
 package password.pwm.util.logging;
 
 
 import com.novell.ldapchai.ChaiUser;
 import com.novell.ldapchai.ChaiUser;
+
 import org.apache.log4j.*;
 import org.apache.log4j.*;
 import org.apache.log4j.xml.DOMConfigurator;
 import org.apache.log4j.xml.DOMConfigurator;
+
 import password.pwm.AppProperty;
 import password.pwm.AppProperty;
 import password.pwm.PwmApplication;
 import password.pwm.PwmApplication;
 import password.pwm.PwmConstants;
 import password.pwm.PwmConstants;
@@ -95,9 +97,8 @@ public class PwmLogManager {
 
 
         initFileLogger(config, fileLogLevel, pwmApplicationPath);
         initFileLogger(config, fileLogLevel, pwmApplicationPath);
 
 
-        // disable jersey warnings.
-        java.util.logging.LogManager.getLogManager().addLogger(java.util.logging.Logger.getLogger("com.sun.jersey.spi.container.servlet.WebComponent"));
-        java.util.logging.LogManager.getLogManager().getLogger("com.sun.jersey.spi.container.servlet.WebComponent").setLevel(java.util.logging.Level.OFF);
+        // disable java's logging altogether, since you can't seem to change the log level for Jersey programmatically, and have it stick.
+        java.util.logging.LogManager.getLogManager().reset();
     }
     }
 
 
     private static void initConsoleLogger(
     private static void initConsoleLogger(