Modify the logger discovery contract to perform the complete set of checks
even in environments (such as an Applet) where System.getProperty() throws a security exception. Previously, this was causing the checks for Log4J or JDK 1.4 logging to be skipped. PR: Bugzilla #7468 Reported By: Tim Vernum (tpv at spamcop.net) git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/logging/trunk@138881 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java,v 1.6 2002/02/27 18:01:41 craigmcc Exp $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2002/02/27 18:01:41 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//logging/src/java/org/apache/commons/logging/impl/LogFactoryImpl.java,v 1.7 2002/03/31 00:31:49 craigmcc Exp $
|
||||
* $Revision: 1.7 $
|
||||
* $Date: 2002/03/31 00:31:49 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
@@ -104,7 +104,7 @@ import org.apache.commons.logging.LogSource;
|
||||
*
|
||||
* @author Rod Waldhoff
|
||||
* @author Craig R. McClanahan
|
||||
* @version $Revision: 1.6 $ $Date: 2002/02/27 18:01:41 $
|
||||
* @version $Revision: 1.7 $ $Date: 2002/03/31 00:31:49 $
|
||||
*/
|
||||
|
||||
public class LogFactoryImpl extends LogFactory {
|
||||
@@ -367,16 +367,25 @@ public class LogFactoryImpl extends LogFactory {
|
||||
|
||||
// Identify the Log implementation class we will be using
|
||||
String logClassName = null;
|
||||
try {
|
||||
if (logClassName == null) {
|
||||
logClassName = (String) getAttribute(LOG_PROPERTY);
|
||||
}
|
||||
if (logClassName == null) { // @deprecated
|
||||
logClassName = (String) getAttribute(LOG_PROPERTY_OLD);
|
||||
}
|
||||
if (logClassName == null) {
|
||||
try {
|
||||
logClassName = System.getProperty(LOG_PROPERTY);
|
||||
} catch (SecurityException e) {
|
||||
;
|
||||
}
|
||||
}
|
||||
if (logClassName == null) { // @deprecated
|
||||
try {
|
||||
logClassName = System.getProperty(LOG_PROPERTY_OLD);
|
||||
} catch (SecurityException e) {
|
||||
;
|
||||
}
|
||||
}
|
||||
if ((logClassName == null) && isLog4JAvailable()) {
|
||||
logClassName =
|
||||
@@ -389,8 +398,6 @@ public class LogFactoryImpl extends LogFactory {
|
||||
if (logClassName == null) {
|
||||
logClassName = LOG_DEFAULT;
|
||||
}
|
||||
} catch (SecurityException e) {
|
||||
}
|
||||
|
||||
// Attempt to load the Log implementation class
|
||||
Class logClass = null;
|
||||
|
||||
Reference in New Issue
Block a user