db-ddlutils-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject svn commit: r634937 - /db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseTaskBase.java
Date Sat, 08 Mar 2008 11:50:52 GMT
Author: tomdz
Date: Sat Mar  8 03:50:45 2008
New Revision: 634937

URL: http://svn.apache.org/viewvc?rev=634937&view=rev
Log:
Fix for DDLUTILS-181: If DatabaseTaskBase._simpleLogging is false, _log is never set

Modified:
    db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseTaskBase.java

Modified: db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseTaskBase.java
URL: http://svn.apache.org/viewvc/db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseTaskBase.java?rev=634937&r1=634936&r2=634937&view=diff
==============================================================================
--- db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseTaskBase.java (original)
+++ db/ddlutils/trunk/src/java/org/apache/ddlutils/task/DatabaseTaskBase.java Sat Mar  8 03:50:45
2008
@@ -300,20 +300,22 @@
      */
     private void initLogging()
     {
-        // For Ant, we're forcing DdlUtils to do logging via log4j to the console
-        Properties props = new Properties();
-        String     level = (_verbosity == null ? Level.INFO.toString() : _verbosity.getValue()).toUpperCase();
-
-        props.setProperty("log4j.rootCategory", level + ",A");
-        props.setProperty("log4j.appender.A", "org.apache.log4j.ConsoleAppender");
-        props.setProperty("log4j.appender.A.layout", "org.apache.log4j.PatternLayout");
-        props.setProperty("log4j.appender.A.layout.ConversionPattern", "%m%n");
-        // we don't want debug logging from Digester/Betwixt
-        props.setProperty("log4j.logger.org.apache.commons", "WARN");
-
-        LogManager.resetConfiguration();
-        PropertyConfigurator.configure(props);
-
+        if (_simpleLogging)
+        {
+            // For Ant, we're forcing DdlUtils to do logging via log4j to the console
+            Properties props = new Properties();
+            String     level = (_verbosity == null ? Level.INFO.toString() : _verbosity.getValue()).toUpperCase();
+    
+            props.setProperty("log4j.rootCategory", level + ",A");
+            props.setProperty("log4j.appender.A", "org.apache.log4j.ConsoleAppender");
+            props.setProperty("log4j.appender.A.layout", "org.apache.log4j.PatternLayout");
+            props.setProperty("log4j.appender.A.layout.ConversionPattern", "%m%n");
+            // we don't want debug logging from Digester
+            props.setProperty("log4j.logger.org.apache.commons", "WARN");
+    
+            LogManager.resetConfiguration();
+            PropertyConfigurator.configure(props);
+        }
         _log = LogFactory.getLog(getClass());
     }
 
@@ -345,9 +347,7 @@
      */
     public void execute() throws BuildException
     {
-        if (_simpleLogging) {
-            initLogging();
-        }
+        initLogging();
 
         if (!hasCommands())
         {



Mime
View raw message