logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carn...@apache.org
Subject svn commit: r823394 - /logging/log4j/trunk/src/main/java/org/apache/log4j/PropertyConfigurator.java
Date Fri, 09 Oct 2009 03:55:17 GMT
Author: carnold
Date: Fri Oct  9 03:55:17 2009
New Revision: 823394

URL: http://svn.apache.org/viewvc?rev=823394&view=rev
Log:
Bug 38061: Really remove stray warnings this time

Modified:
    logging/log4j/trunk/src/main/java/org/apache/log4j/PropertyConfigurator.java

Modified: logging/log4j/trunk/src/main/java/org/apache/log4j/PropertyConfigurator.java
URL: http://svn.apache.org/viewvc/logging/log4j/trunk/src/main/java/org/apache/log4j/PropertyConfigurator.java?rev=823394&r1=823393&r2=823394&view=diff
==============================================================================
--- logging/log4j/trunk/src/main/java/org/apache/log4j/PropertyConfigurator.java (original)
+++ logging/log4j/trunk/src/main/java/org/apache/log4j/PropertyConfigurator.java Fri Oct 
9 03:55:17 2009
@@ -32,9 +32,8 @@
 import java.util.Properties;
 import java.util.StringTokenizer;
 import java.util.Vector;
-import java.util.Map;
-import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
 import org.apache.log4j.config.PropertySetter;
 import org.apache.log4j.helpers.FileWatchdog;
@@ -785,10 +784,22 @@
     			  appender.setErrorHandler(eh);
     			  LogLog.debug("Parsing errorhandler options for \"" + appenderName +"\".");
     			  parseErrorHandler(eh, errorHandlerPrefix, props, repository);
-    			  Properties edited = new Properties(props);
-    			  edited.remove(errorHandlerPrefix + "." + ROOT_REF);
-    			  edited.remove(errorHandlerPrefix + "." + LOGGER_REF);
-    			  edited.remove(errorHandlerPrefix + "." + APPENDER_REF_TAG);
+    			  final Properties edited = new Properties();
+    			  final String[] keys = new String[] { 
+    					  errorHandlerPrefix + "." + ROOT_REF,
+    					  errorHandlerPrefix + "." + LOGGER_REF,
+    					  errorHandlerPrefix + "." + APPENDER_REF_TAG
+    			  };
+    			  for(Iterator iter = props.entrySet().iterator();iter.hasNext();) {
+    				  Map.Entry entry = (Map.Entry) iter.next();
+    				  int i = 0;
+    				  for(; i < keys.length; i++) {
+    					  if(keys[i].equals(entry.getKey())) break;
+    				  }
+    				  if (i == keys.length) {
+    					  edited.put(entry.getKey(), entry.getValue());
+    				  }
+    			  }
     		      PropertySetter.setProperties(eh, edited, errorHandlerPrefix + ".");
     			  LogLog.debug("End of errorhandler parsing for \"" + appenderName +"\".");
     		}



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message