sqoop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1353677 - in /sqoop/trunk/src/java/org/apache/sqoop/tool: JobTool.java MergeTool.java
Date Mon, 25 Jun 2012 17:32:33 GMT
Author: blee
Date: Mon Jun 25 17:32:32 2012
New Revision: 1353677

URL: http://svn.apache.org/viewvc?rev=1353677&view=rev
Log:
SQOOP-460  Verbose logging does not turn the level for correct logger

Modified:
    sqoop/trunk/src/java/org/apache/sqoop/tool/JobTool.java
    sqoop/trunk/src/java/org/apache/sqoop/tool/MergeTool.java

Modified: sqoop/trunk/src/java/org/apache/sqoop/tool/JobTool.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/org/apache/sqoop/tool/JobTool.java?rev=1353677&r1=1353676&r2=1353677&view=diff
==============================================================================
--- sqoop/trunk/src/java/org/apache/sqoop/tool/JobTool.java (original)
+++ sqoop/trunk/src/java/org/apache/sqoop/tool/JobTool.java Mon Jun 25 17:32:32 2012
@@ -34,12 +34,6 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.hadoop.util.ToolRunner;
-
-import org.apache.log4j.Category;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-import com.cloudera.sqoop.Sqoop;
 import com.cloudera.sqoop.SqoopOptions;
 import com.cloudera.sqoop.SqoopOptions.InvalidOptionsException;
 import com.cloudera.sqoop.cli.ToolOptions;
@@ -47,6 +41,7 @@ import com.cloudera.sqoop.metastore.hsql
 import com.cloudera.sqoop.metastore.JobData;
 import com.cloudera.sqoop.metastore.JobStorage;
 import com.cloudera.sqoop.metastore.JobStorageFactory;
+import org.apache.sqoop.util.LoggingUtils;
 
 /**
  * Tool that creates and executes saved jobs.
@@ -322,10 +317,7 @@ public class JobTool extends com.clouder
       throws InvalidOptionsException {
 
     if (in.hasOption(VERBOSE_ARG)) {
-      // Immediately switch into DEBUG logging.
-      Category sqoopLogger = Logger.getLogger(
-          Sqoop.class.getName()).getParent();
-      sqoopLogger.setLevel(Level.DEBUG);
+      LoggingUtils.setDebugLevel();
       LOG.debug("Enabled debug logging.");
     }
 

Modified: sqoop/trunk/src/java/org/apache/sqoop/tool/MergeTool.java
URL: http://svn.apache.org/viewvc/sqoop/trunk/src/java/org/apache/sqoop/tool/MergeTool.java?rev=1353677&r1=1353676&r2=1353677&view=diff
==============================================================================
--- sqoop/trunk/src/java/org/apache/sqoop/tool/MergeTool.java (original)
+++ sqoop/trunk/src/java/org/apache/sqoop/tool/MergeTool.java Mon Jun 25 17:32:32 2012
@@ -25,16 +25,13 @@ import org.apache.commons.cli.OptionBuil
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.util.StringUtils;
-import org.apache.log4j.Category;
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
 import com.cloudera.sqoop.Sqoop;
 import com.cloudera.sqoop.SqoopOptions;
 import com.cloudera.sqoop.SqoopOptions.InvalidOptionsException;
 import com.cloudera.sqoop.cli.RelatedOptions;
 import com.cloudera.sqoop.cli.ToolOptions;
 import com.cloudera.sqoop.mapreduce.MergeJob;
+import org.apache.sqoop.util.LoggingUtils;
 
 /**
  * Tool that merges a more recent dataset on top of an older one.
@@ -142,10 +139,7 @@ public class MergeTool extends com.cloud
       throws InvalidOptionsException {
 
     if (in.hasOption(VERBOSE_ARG)) {
-      // Immediately switch into DEBUG logging.
-      Category sqoopLogger = Logger.getLogger(
-          Sqoop.class.getName()).getParent();
-      sqoopLogger.setLevel(Level.DEBUG);
+      LoggingUtils.setDebugLevel();
       LOG.debug("Enabled debug logging.");
     }
 



Mime
View raw message