commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r822335 - in /commons/proper/configuration/branches/configuration2_experimental: ./ src/main/java/org/apache/commons/configuration2/ src/main/java/org/apache/commons/configuration2/beanutils/ src/main/java/org/apache/commons/configuration2/...
Date Tue, 06 Oct 2009 16:23:09 GMT
Author: rgoers
Date: Tue Oct  6 16:23:08 2009
New Revision: 822335

URL: http://svn.apache.org/viewvc?rev=822335&view=rev
Log:
Switch back to commons logging

Modified:
    commons/proper/configuration/branches/configuration2_experimental/pom.xml
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/JNDIConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaBean.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaClass.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/fs/FileSystem.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ConstantLookup.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/reloading/ManagedReloadingStrategy.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java
    commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/reloading/TestVFSFileMonitorReloadingStrategy.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java
    commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/tree/TestMergeCombiner.java
    commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml

Modified: commons/proper/configuration/branches/configuration2_experimental/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/pom.xml?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/pom.xml (original)
+++ commons/proper/configuration/branches/configuration2_experimental/pom.xml Tue Oct  6 16:23:08 2009
@@ -223,6 +223,23 @@
     </dependency>
 
     <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.1.1</version>
+      <exclusions>
+        <exclusion>
+            <groupId>logkit</groupId>
+            <artifactId>logkit</artifactId>
+        </exclusion>
+        <exclusion>
+            <groupId>avalon-framework</groupId>
+            <artifactId>avalon-framework</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+
+
+    <dependency>
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-vfs</artifactId>
       <version>2.0-SNAPSHOT</version>
@@ -252,7 +269,7 @@
         </exclusion>
       </exclusions>
     </dependency>
-    
+
     <dependency>
       <groupId>xml-resolver</groupId>
       <artifactId>xml-resolver</artifactId>
@@ -338,7 +355,7 @@
       <version>1.2</version>
       <scope>test</scope>
     </dependency>
-    
+
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractConfiguration.java Tue Oct  6 16:23:08 2009
@@ -27,8 +27,6 @@
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.commons.configuration2.converter.Converter;
 import org.apache.commons.configuration2.converter.DefaultPropertyConverter;
@@ -39,6 +37,9 @@
 import org.apache.commons.lang.BooleanUtils;
 import org.apache.commons.lang.text.StrLookup;
 import org.apache.commons.lang.text.StrSubstitutor;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.impl.NoOpLog;
 
 /**
  * <p>Abstract configuration class. Provides basic functionality but does not
@@ -149,7 +150,7 @@
     protected Converter converter = new DefaultPropertyConverter();
 
     /** Stores the logger.*/
-    private Logger log;
+    private Log log;
 
     /**
      * Creates a new instance of <code>AbstractConfiguration</code>.
@@ -372,7 +373,7 @@
      * @return the logger
      * @since 1.4
      */
-    public Logger getLogger()
+    public Log getLogger()
     {
         return log;
     }
@@ -387,16 +388,9 @@
      * @param log the new logger
      * @since 1.4
      */
-    public void setLogger(Logger log)
+    public void setLogger(Log log)
     {
-        if (log == null)
-        {
-            // create a NoOp logger
-            log = Logger.getLogger(getClass().getName() + "." + hashCode());
-            log.setLevel(Level.OFF);
-        }
-
-        this.log = log;
+        this.log = (log != null) ? log : new NoOpLog();
     }
 
     /**
@@ -415,7 +409,7 @@
         {
             public void configurationError(ConfigurationErrorEvent event)
             {
-                getLogger().log(Level.WARNING, "Internal error", event.getCause());
+                getLogger().warn("Internal error", event.getCause());
             }
         });
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/AbstractHierarchicalFileConfiguration.java Tue Oct  6 16:23:08 2009
@@ -29,7 +29,6 @@
 import java.net.URL;
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.logging.Level;
 
 import org.apache.commons.configuration2.event.ConfigurationEvent;
 import org.apache.commons.configuration2.event.ConfigurationListener;
@@ -344,7 +343,7 @@
             }
             catch (IOException e)
             {
-                getLogger().log(Level.WARNING, "Could not close input stream", e);
+                getLogger().warn( "Could not close input stream", e);
             }
         }
     }
@@ -822,9 +821,9 @@
 
                     if (strategy.reloadingRequired())
                     {
-                        if (getLogger().isLoggable(Level.FINE))
+                        if (getLogger().isInfoEnabled())
                         {
-                            getLogger().fine("Reloading configuration. URL is " + getURL());
+                            getLogger().info("Reloading configuration. URL is " + getURL());
                         }
                         fireEvent(EVENT_RELOAD, null, getURL(), true);
                         setDetailEvents(false);
@@ -1077,7 +1076,7 @@
         }
         catch (IOException e)
         {
-            getLogger().log(Level.WARNING, "Could not close output stream", e);
+            getLogger().warn( "Could not close output stream", e);
         }
     }
 }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/CombinedConfiguration.java Tue Oct  6 16:23:08 2009
@@ -23,7 +23,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.logging.Level;
 import java.io.ByteArrayOutputStream;
 import java.io.PrintStream;
 
@@ -690,13 +689,13 @@
             {
                 node = getNodeCombiner().combine(node, it.next().getTransformedRoot());
             }
-            
-            if (getLogger().isLoggable(Level.FINEST))
+
+            if (getLogger().isDebugEnabled())
             {
                 ByteArrayOutputStream os = new ByteArrayOutputStream();
                 PrintStream stream = new PrintStream(os);
                 TreeUtils.printTree(stream, node);
-                getLogger().finest(os.toString());
+                getLogger().debug(os.toString());
             }
             return node;
         }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/ConfigurationUtils.java Tue Oct  6 16:23:08 2009
@@ -27,8 +27,8 @@
 import java.net.URL;
 import java.net.URLDecoder;
 import java.util.Iterator;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.commons.configuration2.event.ConfigurationErrorEvent;
 import org.apache.commons.configuration2.event.ConfigurationErrorListener;
@@ -59,7 +59,7 @@
     private static final String METHOD_CLONE = "clone";
 
     /** The logger.*/
-    private static Logger log = Logger.getLogger(ConfigurationUtils.class.getName());
+    private static Log log = LogFactory.getLog(ConfigurationUtils.class.getName());
 
     /**
      * Private constructor. Prevents instances from being created.
@@ -388,12 +388,12 @@
      */
     public static URL locate(FileSystem fileSystem, String base, String name)
     {
-        if (log.isLoggable(Level.FINE))
+        if (log.isDebugEnabled())
         {
             StringBuilder buf = new StringBuilder();
             buf.append("ConfigurationUtils.locate(): base is ").append(base);
             buf.append(", name is ").append(name);
-            log.fine(buf.toString());
+            log.debug(buf.toString());
         }
 
         if (name == null)
@@ -415,11 +415,11 @@
                 try
                 {
                     url = file.toURI().toURL();
-                    log.fine("Loading configuration from the absolute path " + name);
+                    log.debug("Loading configuration from the absolute path " + name);
                 }
                 catch (MalformedURLException e)
                 {
-                    log.log(Level.WARNING, "Could not obtain URL from file", e);
+                    log.warn("Could not obtain URL from file", e);
                 }
             }
         }
@@ -437,12 +437,12 @@
 
                 if (url != null)
                 {
-                    log.fine("Loading configuration from the path " + file);
+                    log.debug("Loading configuration from the path " + file);
                 }
             }
             catch (MalformedURLException e)
             {
-                log.log(Level.WARNING, "Could not obtain URL from file", e);
+                log.warn("Could not obtain URL from file", e);
             }
         }
 
@@ -459,13 +459,13 @@
 
                 if (url != null)
                 {
-                    log.fine("Loading configuration from the home path " + file);
+                    log.debug("Loading configuration from the home path " + file);
                 }
 
             }
             catch (MalformedURLException e)
             {
-                log.log(Level.WARNING, "Could not obtain URL from file", e);
+                log.warn("Could not obtain URL from file", e);
             }
         }
 
@@ -494,7 +494,7 @@
 
             if (url != null)
             {
-                log.fine("Loading configuration from the context classpath (" + resourceName + ")");
+                log.debug("Loading configuration from the context classpath (" + resourceName + ")");
             }
         }
 
@@ -505,7 +505,7 @@
 
             if (url != null)
             {
-                log.fine("Loading configuration from the system classpath (" + resourceName + ")");
+                log.debug("Loading configuration from the system classpath (" + resourceName + ")");
             }
         }
         return url;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DatabaseConfiguration.java Tue Oct  6 16:23:08 2009
@@ -26,8 +26,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.commons.logging.LogFactory;
 
 import javax.sql.DataSource;
 
@@ -136,7 +135,7 @@
         this.keyColumn = keyColumn;
         this.valueColumn = valueColumn;
         this.name = name;
-        setLogger(Logger.getLogger(getClass().getName()));
+        setLogger(LogFactory.getLog(getClass().getName()));
         addErrorLogListener();  // log errors per default
     }
 
@@ -447,7 +446,7 @@
         }
         catch (SQLException e)
         {
-            getLogger().log(Level.SEVERE, "An error occured on closing the statement", e);
+            getLogger().error( "An error occured on closing the statement", e);
         }
 
         try
@@ -459,7 +458,7 @@
         }
         catch (SQLException e)
         {
-            getLogger().log(Level.SEVERE, "An error occured on closing the connection", e);
+            getLogger().error( "An error occured on closing the connection", e);
         }
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DefaultConfigurationBuilder.java Tue Oct  6 16:23:08 2009
@@ -25,7 +25,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Logger;
+import org.apache.commons.logging.LogFactory;
 
 import javax.naming.InitialContext;
 import javax.sql.DataSource;
@@ -435,7 +435,7 @@
         providers = new HashMap<String, ConfigurationProvider>();
         registerDefaultProviders();
         registerBeanFactory();
-        setLogger(Logger.getLogger(getClass().getName()));
+        setLogger(LogFactory.getLog(getClass().getName()));
         addErrorLogListener();  // log errors per default
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/DynamicCombinedConfiguration.java Tue Oct  6 16:23:08 2009
@@ -26,13 +26,14 @@
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
-import java.util.logging.Logger;
 
 import org.apache.commons.configuration2.event.ConfigurationErrorListener;
 import org.apache.commons.configuration2.event.ConfigurationListener;
 import org.apache.commons.configuration2.tree.ConfigurationNode;
 import org.apache.commons.configuration2.tree.ExpressionEngine;
 import org.apache.commons.configuration2.tree.NodeCombiner;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
 
 /**
  * DynamicCombinedConfiguration allows a set of CombinedConfigurations to be used. Each CombinedConfiguration
@@ -737,7 +738,7 @@
                 config = new CombinedConfiguration(getNodeCombiner());
                 if (loggerName != null)
                 {
-                    Logger log = Logger.getLogger(loggerName);
+                    Log log = LogFactory.getLog(loggerName);
                     if (log != null)
                     {
                         config.setLogger(log);

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/JNDIConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/JNDIConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/JNDIConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/JNDIConfiguration.java Tue Oct  6 16:23:08 2009
@@ -20,7 +20,8 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.logging.Logger;
+import org.apache.commons.logging.LogFactory;
+
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.NameClassPair;
@@ -40,7 +41,7 @@
  * test.foo = value1
  * test.foo.bar = value2
  * </pre>
- * 
+ *
  * <p>In this case setting the <tt>test.foo.bar</tt> property will overwrite
  * <tt>test.foo</tt>, and reciprocally.</p>
  *
@@ -109,7 +110,7 @@
 
         root = new JNDINode(context, prefix, 0);
 
-        setLogger(Logger.getLogger(getClass().getName()));
+        setLogger(LogFactory.getLog(getClass().getName()));
         addErrorLogListener();
     }
 
@@ -128,7 +129,7 @@
 
     /**
      * Sets the maximum depth for searching in the JNDI tree.
-     * 
+     *
      * @param maxDepth the maximum depth
      */
     public void setMaxDepth(int maxDepth)
@@ -301,7 +302,7 @@
                 Context context = (Context) value;
                 context.createSubcontext(name);
 
-                return new JNDINode(context, name, node.depth + 1);                
+                return new JNDINode(context, name, node.depth + 1);
             }
             catch (NamingException e)
             {
@@ -346,7 +347,7 @@
             {
                 config.fireError(EVENT_READ_PROPERTY, null, null, e);
             }
-            
+
             return children;
         }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/MultiFileHierarchicalConfiguration.java Tue Oct  6 16:23:08 2009
@@ -30,7 +30,6 @@
 import java.util.Properties;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
-import java.util.logging.Logger;
 
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.configuration2.event.ConfigurationErrorEvent;
@@ -41,6 +40,8 @@
 import org.apache.commons.configuration2.reloading.ReloadingStrategy;
 import org.apache.commons.configuration2.resolver.EntityResolverSupport;
 import org.apache.commons.configuration2.tree.ConfigurationNode;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.Log;
 import org.xml.sax.EntityResolver;
 
 /**
@@ -717,7 +718,7 @@
         XMLConfiguration configuration = new XMLConfiguration();
         if (loggerName != null)
         {
-            Logger log = Logger.getLogger(loggerName);
+            Log log = LogFactory.getLog(loggerName);
             if (log != null)
             {
                 configuration.setLogger(log);

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/XMLConfiguration.java Tue Oct  6 16:23:08 2009
@@ -32,7 +32,6 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
-import java.util.logging.Level;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
@@ -951,7 +950,7 @@
         }
         catch (SAXParseException spe)
         {
-            this.getLogger().log(Level.FINE, "Error parsing " + source.getSystemId(), spe);
+            this.getLogger().debug( "Error parsing " + source.getSystemId(), spe);
             throw new ConfigurationException("Error parsing " + source.getSystemId(), spe);
         }
         catch (Exception e)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaBean.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaBean.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaBean.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaBean.java Tue Oct  6 16:23:08 2009
@@ -21,7 +21,8 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaClass;
@@ -60,7 +61,7 @@
     private static final String PROPERTY_DELIMITER = ".";
 
     /** The logger.*/
-    private static Logger log = Logger.getLogger(ConfigurationDynaBean.class.getName());
+    private static Log log = LogFactory.getLog(ConfigurationDynaBean.class.getName());
 
     /**
      * Creates a new instance of <code>ConfigurationDynaBean</code> and sets
@@ -71,17 +72,17 @@
     public ConfigurationDynaBean(Configuration configuration)
     {
         super(configuration);
-        if (log.isLoggable(Level.FINEST))
+        if (log.isTraceEnabled())
         {
-            log.finest("ConfigurationDynaBean(" + configuration + ")");
+            log.trace("ConfigurationDynaBean(" + configuration + ")");
         }
     }
 
     public void set(String name, Object value)
     {
-        if (log.isLoggable(Level.FINEST))
+        if (log.isTraceEnabled())
         {
-            log.finest("set(" + name + "," + value + ")");
+            log.trace("set(" + name + "," + value + ")");
         }
 
         if (value == null)
@@ -112,9 +113,9 @@
 
     public Object get(String name)
     {
-        if (log.isLoggable(Level.FINEST))
+        if (log.isTraceEnabled())
         {
-            log.finest("get(" + name + ")");
+            log.trace("get(" + name + ")");
         }
 
         // get configuration property
@@ -129,9 +130,9 @@
             }
         }
 
-        if (log.isLoggable(Level.FINE))
+        if (log.isTraceEnabled())
         {
-            log.fine(name + "=[" + result + "]");
+            log.trace(name + "=[" + result + "]");
         }
 
         if (result == null)

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaClass.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaClass.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaClass.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/beanutils/ConfigurationDynaClass.java Tue Oct  6 16:23:08 2009
@@ -21,7 +21,8 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.commons.beanutils.DynaBean;
 import org.apache.commons.beanutils.DynaClass;
@@ -40,7 +41,7 @@
 public class ConfigurationDynaClass implements DynaClass
 {
     /** The logger.*/
-    private static Logger log = Logger.getLogger(ConfigurationDynaClass.class.getName());
+    private static Log log = LogFactory.getLog(ConfigurationDynaClass.class.getName());
 
     /** Stores the associated configuration.*/
     private Configuration configuration;
@@ -53,18 +54,18 @@
     public ConfigurationDynaClass(Configuration configuration)
     {
         super();
-        if (log.isLoggable(Level.FINEST))
+        if (log.isTraceEnabled())
         {
-            log.finest("ConfigurationDynaClass(" + configuration + ")");
+            log.trace("ConfigurationDynaClass(" + configuration + ")");
         }
         this.configuration = configuration;
     }
 
     public DynaProperty getDynaProperty(String name)
     {
-        if (log.isLoggable(Level.FINEST))
+        if (log.isTraceEnabled())
         {
-            log.finest("getDynaProperty(" + name + ")");
+            log.trace("getDynaProperty(" + name + ")");
         }
 
         if (name == null)
@@ -120,9 +121,9 @@
 
     public DynaProperty[] getDynaProperties()
     {
-        if (log.isLoggable(Level.FINEST))
+        if (log.isTraceEnabled())
         {
-            log.finest("getDynaProperties()");
+            log.trace("getDynaProperties()");
         }
 
         Iterator<String> keys = configuration.getKeys();
@@ -136,9 +137,9 @@
 
         DynaProperty[] propertyArray = new DynaProperty[properties.size()];
         properties.toArray(propertyArray);
-        if (log.isLoggable(Level.FINEST))
+        if (log.isTraceEnabled())
         {
-            log.finest("Found " + properties.size() + " properties.");
+            log.trace("Found " + properties.size() + " properties.");
         }
 
         return propertyArray;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/fs/FileSystem.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/fs/FileSystem.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/fs/FileSystem.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/fs/FileSystem.java Tue Oct  6 16:23:08 2009
@@ -22,8 +22,9 @@
 import java.io.OutputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.impl.NoOpLog;
 
 import org.apache.commons.configuration2.ConfigurationException;
 
@@ -42,7 +43,7 @@
     private static FileSystem fileSystem;
 
     /** The Logger */
-    private Logger log;
+    private Log log;
 
     /** FileSystem options provider */
     private FileOptionsProvider optionsProvider;
@@ -57,7 +58,7 @@
      *
      * @return the logger
      */
-    public Logger getLogger()
+    public Log getLogger()
     {
         return log;
     }
@@ -71,16 +72,9 @@
      *
      * @param log the new logger
      */
-    public void setLogger(Logger log)
+    public void setLogger(Log log)
     {
-        if (log == null)
-        {
-            // create a NoOp logger
-            log = Logger.getLogger(getClass().getName() + "." + hashCode());
-            log.setLevel(Level.OFF);
-        }
-
-        this.log = log;
+        this.log = (log != null) ? log : new NoOpLog();
     }
 
     static
@@ -88,7 +82,7 @@
         String fsClassName = System.getProperty(FILE_SYSTEM);
         if (fsClassName != null)
         {
-            Logger log = Logger.getLogger(FileSystem.class.getName());
+            Log log = LogFactory.getLog(FileSystem.class.getName());
 
             try
             {
@@ -96,23 +90,23 @@
                 if (FileSystem.class.isAssignableFrom(clazz))
                 {
                     fileSystem = (FileSystem) clazz.newInstance();
-                    if (log.isLoggable(Level.FINE))
+                    if (log.isDebugEnabled())
                     {
-                        log.fine("Using " + fsClassName);
+                        log.debug("Using " + fsClassName);
                     }
                 }
             }
             catch (InstantiationException ex)
             {
-                log.log(Level.SEVERE, "Unable to create " + fsClassName, ex);
+                log.error("Unable to create " + fsClassName, ex);
             }
             catch (IllegalAccessException ex)
             {
-                log.log(Level.SEVERE, "Unable to create " + fsClassName, ex);
+                log.error("Unable to create " + fsClassName, ex);
             }
             catch (ClassNotFoundException ex)
             {
-                log.log(Level.SEVERE, "Unable to create " + fsClassName, ex);
+                log.error("Unable to create " + fsClassName, ex);
             }
         }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ConstantLookup.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ConstantLookup.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ConstantLookup.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ConstantLookup.java Tue Oct  6 16:23:08 2009
@@ -20,8 +20,8 @@
 import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.commons.lang.ClassUtils;
 import org.apache.commons.lang.text.StrLookup;
@@ -60,7 +60,7 @@
     private static Map<String, String> constantCache = new HashMap<String, String>();
 
     /** The logger. */
-    private Logger log = Logger.getLogger(getClass().getName());
+    private Log log = LogFactory.getLog(getClass().getName());
 
     /**
      * Tries to resolve the specified variable. The passed in variable name is
@@ -113,7 +113,7 @@
         }
         catch (Exception ex)
         {
-            log.log(Level.WARNING, "Could not obtain value for variable " + var, ex);
+            log.warn("Could not obtain value for variable " + var, ex);
         }
 
         return result;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/interpol/ExprLookup.java Tue Oct  6 16:23:08 2009
@@ -28,7 +28,6 @@
 import org.apache.commons.jexl.ExpressionFactory;
 
 import java.util.ArrayList;
-import java.util.logging.Level;
 
 /**
  * Lookup that allows expressions to be evaluated.
@@ -189,7 +188,7 @@
         }
         catch (Exception e)
         {
-            configuration.getLogger().log(Level.FINE, "Error encountered evaluating " + result, e);
+            configuration.getLogger().debug( "Error encountered evaluating " + result, e);
         }
 
         return result;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/reloading/ManagedReloadingStrategy.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/reloading/ManagedReloadingStrategy.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/reloading/ManagedReloadingStrategy.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/reloading/ManagedReloadingStrategy.java Tue Oct  6 16:23:08 2009
@@ -17,7 +17,8 @@
 
 package org.apache.commons.configuration2.reloading;
 
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.commons.configuration2.FileConfiguration;
 
@@ -30,7 +31,7 @@
 public class ManagedReloadingStrategy implements ReloadingStrategy, ManagedReloadingStrategyMBean
 {
     /** The logger. */
-    private Logger log = Logger.getLogger(getClass().getName());
+    private Log log = LogFactory.getLog(getClass().getName());
 
     /** Stores a reference to the associated configuration. */
     private FileConfiguration configuration;

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/resolver/CatalogResolver.java Tue Oct  6 16:23:08 2009
@@ -23,8 +23,8 @@
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.Vector;
-import java.util.logging.Level;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.commons.configuration2.ConfigurationException;
 import org.apache.commons.configuration2.ConfigurationUtils;
@@ -64,7 +64,7 @@
     private org.apache.xml.resolver.tools.CatalogResolver resolver;
 
     /** Stores the logger. */
-    private Logger log;
+    private Log log;
 
     /**
      * Constructs the CatalogResolver
@@ -183,7 +183,7 @@
             }
             catch (Exception e)
             {
-                log.log(Level.FINE, "Failed to create InputSource for " + resolved, e);
+                log.debug("Failed to create InputSource for " + resolved, e);
                 return null;
             }
         }
@@ -196,7 +196,7 @@
      *
      * @return the logger
      */
-    public Logger getLogger()
+    public Log getLogger()
     {
         return log;
     }
@@ -210,16 +210,9 @@
      *
      * @param log the new logger
      */
-    public void setLogger(Logger log)
+    public void setLogger(Log log)
     {
-        if (log == null)
-        {
-            // create a NoOp logger
-            log = Logger.getLogger(getClass().getName() + "." + hashCode());
-            log.setLevel(Level.OFF);
-        }
-        
-        this.log = log;
+        this.log = (log != null) ? log : LogFactory.getLog(CatalogResolver.class);
     }
 
     private synchronized org.apache.xml.resolver.tools.CatalogResolver getResolver()

Modified: commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/main/java/org/apache/commons/configuration2/tree/MergeCombiner.java Tue Oct  6 16:23:08 2009
@@ -153,4 +153,4 @@
 
         return null;
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestAbstractConfiguration.java Tue Oct  6 16:23:08 2009
@@ -20,7 +20,8 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import junit.framework.TestCase;
 import junitx.framework.ListAssert;
@@ -148,7 +149,7 @@
     {
         AbstractConfiguration config = getEmptyConfiguration();
         assertNotNull("Default logger is null", config.getLogger());
-        Logger log = Logger.getLogger(config.getClass().getName());
+        Log log = LogFactory.getLog(config.getClass().getName());
         config.setLogger(log);
         assertSame("Logger was not set", log, config.getLogger());
     }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestCatalogResolver.java Tue Oct  6 16:23:08 2009
@@ -17,7 +17,8 @@
 
 package org.apache.commons.configuration2;
 
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import junit.framework.TestCase;
 import org.apache.commons.configuration2.resolver.CatalogResolver;
@@ -80,7 +81,7 @@
 
     public void testLogger() throws Exception
     {
-        Logger log = Logger.getLogger(getClass().getName());
+        Log log = LogFactory.getLog(getClass().getName());
         resolver.setLogger(log);
         assertNotNull("No Logger returned", resolver.getLogger());
         assertTrue("Incorrect Logger", log == resolver.getLogger());

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestDefaultConfigurationBuilder.java Tue Oct  6 16:23:08 2009
@@ -18,18 +18,16 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.io.ByteArrayOutputStream;
+import java.io.StringWriter;
 import java.net.URL;
 import java.util.Collection;
 import java.util.Set;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.List;
-import java.util.logging.Logger;
-import java.util.logging.Level;
-import java.util.logging.StreamHandler;
-import java.util.logging.SimpleFormatter;
-import java.util.logging.ConsoleHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.impl.Log4JLogger;
 
 import junit.framework.TestCase;
 
@@ -37,9 +35,11 @@
 import org.apache.commons.configuration2.reloading.FileChangedReloadingStrategy;
 import org.apache.commons.configuration2.tree.DefaultConfigurationNode;
 import org.apache.commons.configuration2.tree.ConfigurationNode;
-import org.apache.commons.configuration2.tree.TreeUtils;
 import org.apache.commons.configuration2.tree.xpath.XPathExpressionEngine;
 import org.apache.commons.lang.text.StrLookup;
+import org.apache.log4j.WriterAppender;
+import org.apache.log4j.SimpleLayout;
+import org.apache.log4j.Logger;
 
 /**
  * Test class for DefaultConfigurationBuilder.
@@ -895,13 +895,13 @@
     public void testMultiTenentConfiguration3() throws Exception
     {
         factory.setFile(MULTI_TENENT_FILE);
-        ByteArrayOutputStream stream = new ByteArrayOutputStream();
-        StreamHandler handler = new StreamHandler(stream, new SimpleFormatter());
-        handler.setLevel(Level.ALL);
-        Logger logger = Logger.getLogger("TestLogger");
-        logger.addHandler(handler);
-        logger.setLevel(Level.ALL);
-        logger.setUseParentHandlers(false);
+        StringWriter writer = new StringWriter();
+        WriterAppender app = new WriterAppender(new SimpleLayout(), writer);
+        Log log = LogFactory.getLog("TestLogger");
+        Logger logger = ((Log4JLogger)log).getLogger();
+        logger.addAppender(app);
+        logger.setLevel(org.apache.log4j.Level.DEBUG);
+        logger.setAdditivity(false);
 
         System.setProperty("Id", "1005");
 
@@ -909,12 +909,11 @@
         assertTrue("Incorrect configuration", config instanceof DynamicCombinedConfiguration);
 
         verify("1001", config, 15);
-        handler.flush();
-        String xml = stream.toString();
+        String xml = writer.getBuffer().toString();
         assertNotNull("No XML returned", xml);
-        assertTrue("Incorect configuration data: " + xml, xml.contains("<rowsPerPage>15</rowsPerPage>"));
-        logger.removeHandler(handler);
-        logger.setLevel(Level.OFF);
+        assertTrue("Incorect configuration data", xml.indexOf("<rowsPerPage>15</rowsPerPage>") >= 0);
+        logger.removeAppender(app);
+        logger.setLevel(org.apache.log4j.Level.OFF);
         verify("1002", config, 25);
         verify("1003", config, 35);
         verify("1004", config, 50);

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestFileConfiguration.java Tue Oct  6 16:23:08 2009
@@ -594,4 +594,4 @@
         StrictConfigurationComparator cc = new StrictConfigurationComparator();
         assertTrue("Configurations are different", cc.compare(config1, config2));
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/TestHierarchicalXMLConfiguration.java Tue Oct  6 16:23:08 2009
@@ -23,7 +23,6 @@
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.commons.configuration2.XMLConfiguration;
 import org.apache.commons.configuration2.expr.xpath.XPathExpressionEngine;
 
 /**
@@ -331,4 +330,4 @@
             assertTrue(saveFile.delete());
         }
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/beanutils/TestConfigurationDynaBean.java Tue Oct  6 16:23:08 2009
@@ -20,8 +20,6 @@
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 import org.apache.commons.beanutils.DynaProperty;
 import org.apache.commons.configuration2.Configuration;
@@ -138,10 +136,6 @@
         bean.set("doubleArray", doubleArray);
         bean.set("byteArray", byteArray);
         bean.set("stringArray", stringArray);
-
-        // enable the finest logging
-        Logger.getLogger(ConfigurationDynaClass.class.getName()).setLevel(Level.ALL);
-        Logger.getLogger(ConfigurationDynaBean.class.getName()).setLevel(Level.ALL);
     }
 
     /**

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/interpol/TestExprLookup.java Tue Oct  6 16:23:08 2009
@@ -19,12 +19,16 @@
 import junit.framework.TestCase;
 
 import java.io.File;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Logger;
-import java.util.logging.Level;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.commons.logging.impl.Log4JLogger;
 
 import org.apache.commons.configuration2.XMLConfiguration;
 import org.apache.commons.configuration2.ConfigurationAssert;
+import org.apache.log4j.Logger;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.SimpleLayout;
+import org.apache.log4j.Level;
 
 /**
  * Test class for ExprLookup.
@@ -56,23 +60,24 @@
 
     public void testLookup() throws Exception
     {
-        ConsoleHandler handler = new ConsoleHandler();
-        Logger logger = Logger.getLogger("TestLogger");
-        logger.addHandler(handler);
-        logger.setLevel(Level.FINE);
+        ConsoleAppender app = new ConsoleAppender(new SimpleLayout());
+        Log log = LogFactory.getLog("TestLogger");
+        Logger logger = ((Log4JLogger) log).getLogger();
+        logger.addAppender(app);
+        logger.setLevel(Level.DEBUG);
         ExprLookup.Variables vars = new ExprLookup.Variables();
         vars.add(new ExprLookup.Variable("String", org.apache.commons.lang.StringUtils.class));
         vars.add(new ExprLookup.Variable("Util", new Utility("Hello")));
         vars.add(new ExprLookup.Variable("System", "Class:java.lang.System"));
         XMLConfiguration config = new XMLConfiguration(TEST_FILE);
-        config.setLogger(logger);
+        config.setLogger(log);
         ExprLookup lookup = new ExprLookup(vars);
         lookup.setConfiguration(config);
         String str = lookup.lookup(PATTERN1);
         assertTrue(str.startsWith("Goodbye"));
         str = lookup.lookup(PATTERN2);
         assertTrue("Incorrect value: " + str, str.equals("value Some text"));
-        logger.removeHandler(handler);
+        logger.removeAppender(app);
 
     }
 

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/reloading/TestVFSFileMonitorReloadingStrategy.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/reloading/TestVFSFileMonitorReloadingStrategy.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/reloading/TestVFSFileMonitorReloadingStrategy.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/reloading/TestVFSFileMonitorReloadingStrategy.java Tue Oct  6 16:23:08 2009
@@ -221,4 +221,4 @@
         }
     }
 
-}
\ No newline at end of file
+}

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/test/HsqlDB.java Tue Oct  6 16:23:08 2009
@@ -22,7 +22,8 @@
 import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.sql.Statement;
-import java.util.logging.Logger;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.commons.lang.StringUtils;
 
@@ -36,7 +37,7 @@
 public class HsqlDB
 {
     private Connection connection = null;
-    private Logger log = Logger.getLogger(getClass().getName());
+    private Log log = LogFactory.getLog(getClass().getName());
 
     public HsqlDB(String uri, String databaseDriver, String loadFile)throws Exception
     {
@@ -84,9 +85,9 @@
                 }
                 catch (SQLException sqle)
                 {
-                    log.warning("Statement: " + cmd + ": " + sqle.getMessage());
+                    log.warn("Statement: " + cmd + ": " + sqle.getMessage());
                 }
-                
+
                 commands = commands.substring(targetPos + 2);
             }
         }

Modified: commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/tree/TestMergeCombiner.java
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/tree/TestMergeCombiner.java?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/tree/TestMergeCombiner.java (original)
+++ commons/proper/configuration/branches/configuration2_experimental/src/test/java/org/apache/commons/configuration2/tree/TestMergeCombiner.java Tue Oct  6 16:23:08 2009
@@ -20,7 +20,6 @@
 
 import org.apache.commons.configuration2.ConfigurationException;
 import org.apache.commons.configuration2.HierarchicalConfiguration;
-import org.apache.commons.configuration2.XMLConfiguration;
 import org.apache.commons.configuration2.tree.xpath.XPathExpressionEngine;
 
 /**
@@ -169,4 +168,4 @@
         assertFalse("No node found", nds.isEmpty());
         return (ConfigurationNode) nds.get(0);
     }
-}
\ No newline at end of file
+}

Modified: commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml?rev=822335&r1=822334&r2=822335&view=diff
==============================================================================
--- commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml (original)
+++ commons/proper/configuration/branches/configuration2_experimental/xdocs/changes.xml Tue Oct  6 16:23:08 2009
@@ -35,12 +35,6 @@
         The dependencies on commons-collections, commons-codec and commons-digester are no longer needed.
       </action>
       <action dev="ebourg" type="update">
-        The java.util.logging API is now used instead of commons-logging. If necessary it's still
-        possible to redirect the log messages to a 3rd party logging API using a bridging mechanism
-        such as the one available for Log4J
-        (see http://people.apache.org/~psmith/logging.apache.org/sandbox/jul-log4j-bridge/).
-      </action>
-      <action dev="ebourg" type="update">
         Calendar objects in PropertyListConfiguration are now saved with their own time zone.
       </action>
       <action dev="ebourg" type="remove">
@@ -91,7 +85,7 @@
       </action>
       <action dev="rgoers" type="fix" issue="CONFIGURATION-388">
         Attribute or element values will not be escaped when attribute or element splitting are disabled.
-      </action>      
+      </action>
       <action dev="oheger" type="fix" issue="CONFIGURATION-385">
         DatabaseConfiguration now generates correct events for the clear() and
         clearProperty() methods.



Mime
View raw message