zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jongy...@apache.org
Subject incubator-zeppelin git commit: ZEPPELIN-541 - increase logging in application
Date Sun, 10 Jan 2016 06:32:13 GMT
Repository: incubator-zeppelin
Updated Branches:
  refs/heads/master 51812cb80 -> ff99ecba1


ZEPPELIN-541 - increase logging in application

### What is this PR for?
To increase logging in the application, so as it

### What type of PR is it?
Refactoring

### Todos
* [x] - replace all printStackTrace() to LOGGER.error
* [x] - all catch block that doesn't throw exception, should have logging

### Is there a relevant Jira issue?
Yes, ZEPPELIN-541

### Screenshots (if appropriate)
N/A

Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>

Closes #579 from prabhjyotsingh/increaseLogging and squashes the following commits:

ba053f5 [Prabhjyot Singh] revert note.json
648c65c [Prabhjyot Singh] fix CI
6d927fc [Prabhjyot Singh] Every catch should log error/info message or should throw an exception
7f8b70c [Prabhjyot Singh] replace printStackTrace() to LOGGER.error


Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/ff99ecba
Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/ff99ecba
Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/ff99ecba

Branch: refs/heads/master
Commit: ff99ecba1bdf51ef66e92970d926821bf550aa2b
Parents: 51812cb
Author: Prabhjyot Singh <prabhjyotsingh@gmail.com>
Authored: Tue Jan 5 20:19:33 2016 +0530
Committer: Jongyoul Lee <jongyoul@apache.org>
Committed: Sun Jan 10 15:31:57 2016 +0900

----------------------------------------------------------------------
 .../zeppelin/ignite/IgniteInterpreter.java      |   1 +
 .../zeppelin/ignite/IgniteSqlInterpreter.java   |   2 +
 .../apache/zeppelin/lens/LensInterpreter.java   |   3 +-
 .../zeppelin/lens/LensJLineShellComponent.java  |   7 +-
 .../org/apache/zeppelin/markdown/Markdown.java  |   4 +
 .../postgresql/PostgreSqlInterpreter.java       |   1 +
 .../apache/zeppelin/spark/DepInterpreter.java   |   4 +
 .../apache/zeppelin/spark/SparkInterpreter.java |   4 +-
 .../zeppelin/spark/SparkInterpreterTest.java    |   5 +-
 .../zeppelin/spark/SparkSqlInterpreterTest.java |   5 +
 .../apache/zeppelin/tajo/TesterResultSet.java   |  14 +-
 .../zeppelin/interpreter/Interpreter.java       |   2 +-
 .../zeppelin/interpreter/InterpreterGroup.java  |   8 +-
 .../remote/RemoteAngularObjectRegistry.java     |   1 -
 .../remote/RemoteInterpreterEventPoller.java    |   1 +
 .../remote/RemoteInterpreterProcess.java        |   8 +
 .../remote/RemoteInterpreterServer.java         |   9 +-
 .../remote/RemoteInterpreterUtils.java          |   5 +
 .../zeppelin/scheduler/FIFOScheduler.java       |   5 +
 .../java/org/apache/zeppelin/scheduler/Job.java |  10 +-
 .../zeppelin/scheduler/JobProgressPoller.java   |   1 +
 .../zeppelin/scheduler/ParallelScheduler.java   |   5 +
 .../zeppelin/scheduler/RemoteScheduler.java     |  16 +-
 .../zeppelin/scheduler/SchedulerFactory.java    |   4 +-
 .../remote/mock/MockInterpreterAngular.java     |   1 +
 .../apache/zeppelin/scheduler/SleepingJob.java  |   5 +
 .../zeppelin/rest/InterpreterRestApi.java       |   3 +
 .../apache/zeppelin/rest/NotebookRestApi.java   |   1 +
 .../org/apache/zeppelin/server/CorsFilter.java  |   8 +-
 .../apache/zeppelin/server/ZeppelinServer.java  |   1 +
 .../apache/zeppelin/socket/NotebookServer.java  |   6 +-
 .../ScreenCaptureHtmlUnitDriver.java            |   7 +
 .../java/org/apache/zeppelin/ProcessData.java   |   1 +
 .../org/apache/zeppelin/WebDriverManager.java   |   7 +-
 .../java/org/apache/zeppelin/ZeppelinIT.java    |   3 +
 .../org/apache/zeppelin/ZeppelinITUtils.java    |   2 +-
 .../zeppelin/rest/AbstractTestRestApi.java      |  14 +-
 .../zeppelin/rest/ZeppelinSparkClusterTest.java |   2 +-
 .../zeppelin/socket/NotebookServerTest.java     |  16 +-
 .../zeppelin/conf/ZeppelinConfiguration.java    |   1 +
 .../interpreter/InterpreterFactory.java         |  34 ++---
 .../org/apache/zeppelin/notebook/Notebook.java  |   8 +-
 .../apache/zeppelin/notebook/NotebookTest.java  |   2 +-
 .../notebook/repo/NotebookRepoSyncTest.java     |   2 +-
 .../notebook/repo/VFSNotebookRepoTest.java      |   2 +-
 .../org/apache/zeppelin/util/UtilsForTests.java | 145 ++++++++++---------
 46 files changed, 239 insertions(+), 157 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteInterpreter.java
----------------------------------------------------------------------
diff --git a/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteInterpreter.java b/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteInterpreter.java
index 45236ab..57fa657 100644
--- a/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteInterpreter.java
+++ b/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteInterpreter.java
@@ -211,6 +211,7 @@ public class IgniteInterpreter extends Interpreter {
 
         initEx = null;
       } catch (Exception e) {
+        logger.error("Error in IgniteInterpreter while getIgnite: " , e);
         initEx = e;
       }
     }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteSqlInterpreter.java
----------------------------------------------------------------------
diff --git a/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteSqlInterpreter.java b/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteSqlInterpreter.java
index f7e6330..15891cc 100644
--- a/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteSqlInterpreter.java
+++ b/ignite/src/main/java/org/apache/zeppelin/ignite/IgniteSqlInterpreter.java
@@ -154,6 +154,7 @@ public class IgniteSqlInterpreter extends Interpreter {
         }
       }
     } catch (Exception e) {
+      logger.error("Exception in IgniteSqlInterpreter while InterpreterResult interpret: ", e);
       return IgniteInterpreterUtils.buildErrorResult(e);
     } finally {
       curStmt = null;
@@ -169,6 +170,7 @@ public class IgniteSqlInterpreter extends Interpreter {
         curStmt.cancel();
       } catch (SQLException e) {
         // No-op.
+        logger.info("No-op while cancel in IgniteSqlInterpreter", e);
       } finally {
         curStmt = null;
       }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
----------------------------------------------------------------------
diff --git a/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java b/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
index 2632775..c71dcc0 100644
--- a/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
+++ b/lens/src/main/java/org/apache/zeppelin/lens/LensInterpreter.java
@@ -128,7 +128,7 @@ public class LensInterpreter extends Interpreter {
       s_logger.info("LensInterpreter created");
     }
     catch (Exception e) {
-      e.printStackTrace();
+      s_logger.error(e.toString(), e);
       s_logger.error("unable to create lens interpreter", e);
     }
   }
@@ -375,6 +375,7 @@ public class LensInterpreter extends Interpreter {
         closeShell(s_paraToQH.get(context.getParagraphId()).getShell());
       } catch (Exception e) {
         // ignore
+        s_logger.info("Exception in LensInterpreter while cancel finally, ignore", e);
       }
       s_paraToQH.remove(context.getParagraphId());
       closeShell(shell);

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java
----------------------------------------------------------------------
diff --git a/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java b/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java
index f025d53..7bf2059 100644
--- a/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java
+++ b/lens/src/main/java/org/apache/zeppelin/lens/LensJLineShellComponent.java
@@ -17,6 +17,9 @@ package org.apache.zeppelin.lens;
 
 import java.util.Map;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import org.springframework.beans.BeansException;
 import org.springframework.beans.factory.BeanFactoryUtils;
 import org.springframework.beans.factory.InitializingBean;
@@ -56,6 +59,8 @@ public class LensJLineShellComponent extends JLineShell
   private ExecutionStrategy executionStrategy = new LensSimpleExecutionStrategy();
   private SimpleParser parser = new SimpleParser();
 
+  private static final Logger LOGGER = LoggerFactory.getLogger(LensJLineShellComponent.class);
+
   public SimpleParser getSimpleParser() {
     return parser;
   }
@@ -123,7 +128,7 @@ public class LensJLineShellComponent extends JLineShell
     try {
       shellThread.join();
     } catch (InterruptedException e) {
-      e.printStackTrace();
+      LOGGER.error(e.toString(), e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/markdown/src/main/java/org/apache/zeppelin/markdown/Markdown.java
----------------------------------------------------------------------
diff --git a/markdown/src/main/java/org/apache/zeppelin/markdown/Markdown.java b/markdown/src/main/java/org/apache/zeppelin/markdown/Markdown.java
index 4a98c60..fe96492 100644
--- a/markdown/src/main/java/org/apache/zeppelin/markdown/Markdown.java
+++ b/markdown/src/main/java/org/apache/zeppelin/markdown/Markdown.java
@@ -29,12 +29,15 @@ import org.apache.zeppelin.interpreter.InterpreterUtils;
 import org.apache.zeppelin.scheduler.Scheduler;
 import org.apache.zeppelin.scheduler.SchedulerFactory;
 import org.markdown4j.Markdown4jProcessor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Markdown interpreter for Zeppelin.
  */
 public class Markdown extends Interpreter {
   private Markdown4jProcessor md;
+  static final Logger LOGGER = LoggerFactory.getLogger(Markdown.class);
 
   static {
     Interpreter.register("md", Markdown.class.getName());
@@ -58,6 +61,7 @@ public class Markdown extends Interpreter {
     try {
       html = md.process(st);
     } catch (IOException | java.lang.RuntimeException e) {
+      LOGGER.error("Exception in Markdown while interpret ", e);
       return new InterpreterResult(Code.ERROR, InterpreterUtils.getMostRelevantMessage(e));
     }
     return new InterpreterResult(Code.SUCCESS, "%html " + html);

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/postgresql/src/main/java/org/apache/zeppelin/postgresql/PostgreSqlInterpreter.java
----------------------------------------------------------------------
diff --git a/postgresql/src/main/java/org/apache/zeppelin/postgresql/PostgreSqlInterpreter.java b/postgresql/src/main/java/org/apache/zeppelin/postgresql/PostgreSqlInterpreter.java
index 4189a74..f1bcab4 100644
--- a/postgresql/src/main/java/org/apache/zeppelin/postgresql/PostgreSqlInterpreter.java
+++ b/postgresql/src/main/java/org/apache/zeppelin/postgresql/PostgreSqlInterpreter.java
@@ -297,6 +297,7 @@ public class PostgreSqlInterpreter extends Interpreter {
       try {
         currentStatement.cancel();
       } catch (SQLException ex) {
+        logger.error("SQLException in PostgreSqlInterpreter while cancel ", ex);
       } finally {
         currentStatement = null;
       }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java
----------------------------------------------------------------------
diff --git a/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java b/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java
index 67eadad..7a17aa0 100644
--- a/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java
+++ b/spark/src/main/java/org/apache/zeppelin/spark/DepInterpreter.java
@@ -41,6 +41,8 @@ import org.apache.zeppelin.interpreter.InterpreterResult.Code;
 import org.apache.zeppelin.interpreter.WrappedInterpreter;
 import org.apache.zeppelin.scheduler.Scheduler;
 import org.apache.zeppelin.spark.dep.DependencyContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.sonatype.aether.resolution.ArtifactResolutionException;
 import org.sonatype.aether.resolution.DependencyResolutionException;
 
@@ -80,6 +82,7 @@ public class DepInterpreter extends Interpreter {
   private DependencyContext depc;
   private SparkJLineCompletion completor;
   private SparkILoop interpreter;
+  static final Logger LOGGER = LoggerFactory.getLogger(DepInterpreter.class);
 
   public DepInterpreter(Properties property) {
     super(property);
@@ -195,6 +198,7 @@ public class DepInterpreter extends Interpreter {
       depc.fetch();
     } catch (MalformedURLException | DependencyResolutionException
         | ArtifactResolutionException e) {
+      LOGGER.error("Exception in DepInterpreter while interpret ", e);
       return new InterpreterResult(Code.ERROR, e.toString());
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java
----------------------------------------------------------------------
diff --git a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java
index 2f2829e..08eb0fa 100644
--- a/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java
+++ b/spark/src/main/java/org/apache/zeppelin/spark/SparkInterpreter.java
@@ -82,7 +82,7 @@ import scala.tools.nsc.settings.MutableSettings.PathSetting;
  *
  */
 public class SparkInterpreter extends Interpreter {
-  Logger logger = LoggerFactory.getLogger(SparkInterpreter.class);
+  public static Logger logger = LoggerFactory.getLogger(SparkInterpreter.class);
 
   static {
     Interpreter.register(
@@ -186,7 +186,7 @@ public class SparkInterpreter extends Interpreter {
       }
     } catch (NoSuchMethodException | SecurityException | IllegalAccessException
         | IllegalArgumentException | InvocationTargetException e) {
-      e.printStackTrace();
+      logger.error(e.toString(), e);
       return null;
     }
     return pl;

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/spark/src/test/java/org/apache/zeppelin/spark/SparkInterpreterTest.java
----------------------------------------------------------------------
diff --git a/spark/src/test/java/org/apache/zeppelin/spark/SparkInterpreterTest.java b/spark/src/test/java/org/apache/zeppelin/spark/SparkInterpreterTest.java
index be65c09..b629978 100644
--- a/spark/src/test/java/org/apache/zeppelin/spark/SparkInterpreterTest.java
+++ b/spark/src/test/java/org/apache/zeppelin/spark/SparkInterpreterTest.java
@@ -38,12 +38,15 @@ import org.junit.Before;
 import org.junit.FixMethodOrder;
 import org.junit.Test;
 import org.junit.runners.MethodSorters;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class SparkInterpreterTest {
   public static SparkInterpreter repl;
   private InterpreterContext context;
   private File tmpDir;
+  public static Logger LOGGER = LoggerFactory.getLogger(SparkInterpreterTest.class);
 
 
   /**
@@ -177,7 +180,7 @@ public class SparkInterpreterTest {
     for (Object oKey : intpProperty.keySet()) {
       String key = (String) oKey;
       String value = (String) intpProperty.get(key);
-      repl.logger.debug(String.format("[%s]: [%s]", key, value));
+      LOGGER.debug(String.format("[%s]: [%s]", key, value));
       if (key.startsWith("spark.") && value.isEmpty()) {
         assertTrue(String.format("configuration starting from 'spark.' should not be empty. [%s]", key), !sparkConf.contains(key) || !sparkConf.get(key).isEmpty());
       }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/spark/src/test/java/org/apache/zeppelin/spark/SparkSqlInterpreterTest.java
----------------------------------------------------------------------
diff --git a/spark/src/test/java/org/apache/zeppelin/spark/SparkSqlInterpreterTest.java b/spark/src/test/java/org/apache/zeppelin/spark/SparkSqlInterpreterTest.java
index bb818fd..4688cf8 100644
--- a/spark/src/test/java/org/apache/zeppelin/spark/SparkSqlInterpreterTest.java
+++ b/spark/src/test/java/org/apache/zeppelin/spark/SparkSqlInterpreterTest.java
@@ -33,6 +33,8 @@ import org.apache.zeppelin.interpreter.InterpreterResult.Type;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SparkSqlInterpreterTest {
 
@@ -41,6 +43,8 @@ public class SparkSqlInterpreterTest {
   private InterpreterContext context;
   private InterpreterGroup intpGroup;
 
+  Logger LOGGER = LoggerFactory.getLogger(SparkSqlInterpreterTest.class);
+
   @Before
   public void setUp() throws Exception {
     Properties p = new Properties();
@@ -96,6 +100,7 @@ public class SparkSqlInterpreterTest {
       fail("Exception not catched");
     } catch (Exception e) {
       // okay
+      LOGGER.info("Exception in SparkSqlInterpreterTest while test ", e);
     }
     assertEquals(InterpreterResult.Code.SUCCESS, sql.interpret("select case when name==\"aa\" then name else name end from test", context).code());
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/tajo/src/test/java/org/apache/zeppelin/tajo/TesterResultSet.java
----------------------------------------------------------------------
diff --git a/tajo/src/test/java/org/apache/zeppelin/tajo/TesterResultSet.java b/tajo/src/test/java/org/apache/zeppelin/tajo/TesterResultSet.java
index dc174be..a068975 100644
--- a/tajo/src/test/java/org/apache/zeppelin/tajo/TesterResultSet.java
+++ b/tajo/src/test/java/org/apache/zeppelin/tajo/TesterResultSet.java
@@ -17,13 +17,16 @@
  */
 package org.apache.zeppelin.tajo;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.UnsupportedEncodingException;
 import java.math.BigDecimal;
 import java.sql.*;
 import java.util.Calendar;
 import java.util.Map;
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
 
 /**
  * This is borrowed from Apache Commons DBCP2.
@@ -31,6 +34,9 @@ import java.io.UnsupportedEncodingException;
  * A dummy {@link java.sql.ResultSet}, for testing purposes.
  */
 public class TesterResultSet implements ResultSet {
+
+  Logger LOGGER = LoggerFactory.getLogger(TesterResultSet.class);
+
   public TesterResultSet(Statement stmt) {
     _statement = stmt;
   }
@@ -262,6 +268,8 @@ public class TesterResultSet implements ResultSet {
       return columnName.getBytes("UTF-8");
     } catch (UnsupportedEncodingException e) {
       // Impossible. JVMs are required to support UTF-8
+      LOGGER.error("Exception in TesterResultSet while getBytes, Impossible. JVMs are required to" +
+          " support UTF-8", e);
       return null;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
index d9bb0bf..ac251d2 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/Interpreter.java
@@ -131,7 +131,7 @@ public abstract class Interpreter {
 
 
 
-  static Logger logger = LoggerFactory.getLogger(Interpreter.class);
+  public static Logger logger = LoggerFactory.getLogger(Interpreter.class);
   private InterpreterGroup interpreterGroup;
   private URL [] classloaderUrls;
   protected Properties property;

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/InterpreterGroup.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/InterpreterGroup.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/InterpreterGroup.java
index 9256bcd..5af6241 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/InterpreterGroup.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/InterpreterGroup.java
@@ -33,6 +33,8 @@ import org.apache.zeppelin.interpreter.remote.RemoteInterpreterProcess;
 public class InterpreterGroup extends LinkedList<Interpreter>{
   String id;
 
+  Logger LOGGER = Logger.getLogger(InterpreterGroup.class);
+
   AngularObjectRegistry angularObjectRegistry;
   RemoteInterpreterProcess remoteInterpreterProcess;    // attached remote interpreter process
 
@@ -100,8 +102,7 @@ public class InterpreterGroup extends LinkedList<Interpreter>{
       try {
         t.join();
       } catch (InterruptedException e) {
-        Logger logger = Logger.getLogger(InterpreterGroup.class);
-        logger.error("Can't close interpreter", e);
+        LOGGER.error("Can't close interpreter", e);
       }
     }
   }
@@ -124,8 +125,7 @@ public class InterpreterGroup extends LinkedList<Interpreter>{
       try {
         t.join();
       } catch (InterruptedException e) {
-        Logger logger = Logger.getLogger(InterpreterGroup.class);
-        logger.error("Can't close interpreter", e);
+        LOGGER.error("Can't close interpreter", e);
       }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteAngularObjectRegistry.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteAngularObjectRegistry.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteAngularObjectRegistry.java
index a7ddf49..9b33cb8 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteAngularObjectRegistry.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteAngularObjectRegistry.java
@@ -101,7 +101,6 @@ public class RemoteAngularObjectRegistry extends AngularObjectRegistry {
    * this method should be used instead of remove()
    * @param name
    * @param noteId
-   * @param emit
    * @return
    */
   public AngularObject removeAndNotifyRemoteProcess(String name, String noteId) {

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java
index d08d43e..c39e0fe 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterEventPoller.java
@@ -124,6 +124,7 @@ public class RemoteInterpreterEventPoller extends Thread {
         wait(1000);
       }
     } catch (InterruptedException ignored) {
+      logger.info("Error in RemoteInterpreterEventPoller while waitQuietly : ", ignored);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
index 8d96f4c..2c195dc 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterProcess.java
@@ -121,6 +121,8 @@ public class RemoteInterpreterProcess implements ExecuteResultHandler {
             try {
               Thread.sleep(500);
             } catch (InterruptedException e) {
+              logger.error("Exception in RemoteInterpreterProcess while synchronized reference " +
+                  "Thread.sleep", e);
             }
           }
         }
@@ -177,6 +179,8 @@ public class RemoteInterpreterProcess implements ExecuteResultHandler {
           client.shutdown();
         } catch (Exception e) {
           // safely ignore exception while client.shutdown() may terminates remote process
+          logger.info("Exception in RemoteInterpreterProcess while synchronized dereference, can " +
+              "safely ignore exception while client.shutdown() may terminates remote process", e);
         } finally {
           if (client != null) {
             // no longer used
@@ -195,6 +199,8 @@ public class RemoteInterpreterProcess implements ExecuteResultHandler {
             try {
               Thread.sleep(500);
             } catch (InterruptedException e) {
+              logger.error("Exception in RemoteInterpreterProcess while synchronized dereference " +
+                  "Thread.sleep", e);
             }
           } else {
             break;
@@ -266,6 +272,8 @@ public class RemoteInterpreterProcess implements ExecuteResultHandler {
       client = getClient();
     } catch (NullPointerException e) {
       // remote process not started
+      logger.info("NullPointerException in RemoteInterpreterProcess while " +
+          "updateRemoteAngularObject getClient, remote process not started", e);
       return;
     } catch (Exception e) {
       logger.error("Can't update angular object", e);

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
index 46a0708..a8da8c0 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterServer.java
@@ -114,6 +114,7 @@ public class RemoteInterpreterServer
       try {
         Thread.sleep(300);
       } catch (InterruptedException e) {
+        logger.info("Exception in RemoteInterpreterServer while shutdown, Thread.sleep", e);
       }
     }
 
@@ -170,7 +171,7 @@ public class RemoteInterpreterServer
     } catch (ClassNotFoundException | NoSuchMethodException | SecurityException
         | InstantiationException | IllegalAccessException
         | IllegalArgumentException | InvocationTargetException e) {
-      e.printStackTrace();
+      logger.error(e.toString(), e);
       throw new TException(e);
     }
   }
@@ -225,6 +226,7 @@ public class RemoteInterpreterServer
         try {
           jobListener.wait(1000);
         } catch (InterruptedException e) {
+          logger.info("Exception in RemoteInterpreterServer while interpret, jobListener.wait", e);
         }
       }
     }
@@ -455,6 +457,7 @@ public class RemoteInterpreterServer
         try {
           eventQueue.wait(1000);
         } catch (InterruptedException e) {
+          logger.info("Exception in RemoteInterpreterServer while getEvent, eventQueue.wait", e);
         }
       }
 
@@ -468,7 +471,6 @@ public class RemoteInterpreterServer
 
   /**
    * called when object is updated in client (web) side.
-   * @param className
    * @param name
    * @param noteId noteId where the update issues
    * @param object
@@ -499,6 +501,7 @@ public class RemoteInterpreterServer
         return;
       } catch (Exception e) {
         // no luck
+        logger.info("Exception in RemoteInterpreterServer while angularObjectUpdate, no luck", e);
       }
     }
 
@@ -510,6 +513,7 @@ public class RemoteInterpreterServer
           }.getType());
       } catch (Exception e) {
         // no lock
+        logger.info("Exception in RemoteInterpreterServer while angularObjectUpdate, no lock", e);
       }
     }
 
@@ -544,6 +548,7 @@ public class RemoteInterpreterServer
           }.getType());
     } catch (Exception e) {
       // nolock
+      logger.info("Exception in RemoteInterpreterServer while angularObjectAdd, nolock", e);
     }
 
     // try string object type at last

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
index 27983ae..4d2e46e 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/interpreter/remote/RemoteInterpreterUtils.java
@@ -17,6 +17,9 @@
 
 package org.apache.zeppelin.interpreter.remote;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
@@ -26,6 +29,7 @@ import java.net.Socket;
  *
  */
 public class RemoteInterpreterUtils {
+  static Logger LOGGER = LoggerFactory.getLogger(RemoteInterpreterUtils.class);
   public static int findRandomAvailablePortOnAllLocalInterfaces() throws IOException {
     int port;
     try (ServerSocket socket = new ServerSocket(0);) {
@@ -43,6 +47,7 @@ public class RemoteInterpreterUtils {
       discover.close();
       return true;
     } catch (IOException e) {
+      LOGGER.info("Exception in RemoteInterpreterUtils while checkIfRemoteEndpointAccessible", e);
       return false;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/FIFOScheduler.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/FIFOScheduler.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/FIFOScheduler.java
index 11b5618..1837e4d 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/FIFOScheduler.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/FIFOScheduler.java
@@ -24,6 +24,8 @@ import java.util.List;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.zeppelin.scheduler.Job.Status;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * FIFOScheduler runs submitted job sequentially
@@ -36,6 +38,8 @@ public class FIFOScheduler implements Scheduler {
   Job runningJob = null;
   private String name;
 
+  static Logger LOGGER = LoggerFactory.getLogger(FIFOScheduler.class);
+
   public FIFOScheduler(String name, ExecutorService executor, SchedulerListener listener) {
     this.name = name;
     this.executor = executor;
@@ -107,6 +111,7 @@ public class FIFOScheduler implements Scheduler {
             try {
               queue.wait(500);
             } catch (InterruptedException e) {
+              LOGGER.error("Exception in FIFOScheduler while run queue.wait", e);
             }
             continue;
           }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
index 6379e4c..d9b93f2 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/Job.java
@@ -78,6 +78,8 @@ public abstract class Job {
   Date dateFinished;
   Status status;
 
+  static Logger LOGGER = LoggerFactory.getLogger(Job.class);
+
   transient boolean aborted = false;
 
   String errorMessage;
@@ -172,14 +174,14 @@ public abstract class Job {
       dateFinished = new Date();
       progressUpdator.terminate();
     } catch (NullPointerException e) {
-      logger().error("Job failed", e);
+      LOGGER.error("Job failed", e);
       progressUpdator.terminate();
       this.exception = e;
       result = e.getMessage();
       errorMessage = getStack(e);
       dateFinished = new Date();
     } catch (Throwable e) {
-      logger().error("Job failed", e);
+      LOGGER.error("Job failed", e);
       progressUpdator.terminate();
       this.exception = e;
       result = e.getMessage();
@@ -248,10 +250,6 @@ public abstract class Job {
     return dateFinished;
   }
 
-  private Logger logger() {
-    return LoggerFactory.getLogger(Job.class);
-  }
-
   protected void setResult(Object result) {
     this.result = result;
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/JobProgressPoller.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/JobProgressPoller.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/JobProgressPoller.java
index 2d30394..967702a 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/JobProgressPoller.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/JobProgressPoller.java
@@ -57,6 +57,7 @@ public class JobProgressPoller extends Thread {
       try {
         Thread.sleep(intervalMs);
       } catch (InterruptedException e) {
+        logger.error("Exception in JobProgressPoller while run Thread.sleep", e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/ParallelScheduler.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/ParallelScheduler.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/ParallelScheduler.java
index 8507861..1873944 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/ParallelScheduler.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/ParallelScheduler.java
@@ -24,6 +24,8 @@ import java.util.List;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.zeppelin.scheduler.Job.Status;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Parallel scheduler runs submitted job concurrently.
@@ -37,6 +39,8 @@ public class ParallelScheduler implements Scheduler {
   private String name;
   private int maxConcurrency;
 
+  static Logger LOGGER = LoggerFactory.getLogger(ParallelScheduler.class);
+
   public ParallelScheduler(String name, ExecutorService executor, SchedulerListener listener,
       int maxConcurrency) {
     this.name = name;
@@ -107,6 +111,7 @@ public class ParallelScheduler implements Scheduler {
           try {
             queue.wait(500);
           } catch (InterruptedException e) {
+            LOGGER.error("Exception in MockInterpreterAngular while interpret queue.wait", e);
           }
           continue;
         }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/RemoteScheduler.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/RemoteScheduler.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/RemoteScheduler.java
index 9be5c22..af0c2f6 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/RemoteScheduler.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/RemoteScheduler.java
@@ -17,12 +17,6 @@
 
 package org.apache.zeppelin.scheduler;
 
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-
 import org.apache.thrift.TException;
 import org.apache.zeppelin.interpreter.InterpreterResult;
 import org.apache.zeppelin.interpreter.InterpreterResult.Code;
@@ -32,6 +26,12 @@ import org.apache.zeppelin.scheduler.Job.Status;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+
 /**
  * RemoteScheduler runs in ZeppelinServer and proxies Scheduler running on RemoteInterpreter
  */
@@ -67,6 +67,7 @@ public class RemoteScheduler implements Scheduler {
           try {
             queue.wait(500);
           } catch (InterruptedException e) {
+            logger.error("Exception in RemoteScheduler while run queue.wait", e);
           }
           continue;
         }
@@ -86,6 +87,8 @@ public class RemoteScheduler implements Scheduler {
           try {
             queue.wait(500);
           } catch (InterruptedException e) {
+            logger.error("Exception in RemoteScheduler while jobRunner.isJobSubmittedInRemote " +
+                "queue.wait", e);
           }
         }
       }
@@ -194,6 +197,7 @@ public class RemoteScheduler implements Scheduler {
           try {
             this.wait(interval);
           } catch (InterruptedException e) {
+            logger.error("Exception in RemoteScheduler while run this.wait", e);
           }
         }
 

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/SchedulerFactory.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/SchedulerFactory.java b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/SchedulerFactory.java
index c4e72b5..8b47145 100644
--- a/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/SchedulerFactory.java
+++ b/zeppelin-interpreter/src/main/java/org/apache/zeppelin/scheduler/SchedulerFactory.java
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
  * TODO(moon) : add description.
  */
 public class SchedulerFactory implements SchedulerListener {
-  private final Logger logger = LoggerFactory.getLogger(SchedulerFactory.class);
+  private static final Logger logger = LoggerFactory.getLogger(SchedulerFactory.class);
   ExecutorService executor;
   Map<String, Scheduler> schedulers = new LinkedHashMap<String, Scheduler>();
 
@@ -46,7 +46,7 @@ public class SchedulerFactory implements SchedulerListener {
           try {
             singleton = new SchedulerFactory();
           } catch (Exception e) {
-            e.printStackTrace();
+            logger.error(e.toString(), e);
           }
         }
       }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterAngular.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterAngular.java b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterAngular.java
index 3024f13..7c1a2f0 100644
--- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterAngular.java
+++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/interpreter/remote/mock/MockInterpreterAngular.java
@@ -90,6 +90,7 @@ public class MockInterpreterAngular extends Interpreter {
     try {
       Thread.sleep(500); // wait for watcher executed
     } catch (InterruptedException e) {
+      logger.error("Exception in MockInterpreterAngular while interpret Thread.sleep", e);
     }
 
     String msg = registry.getAll(context.getNoteId()).size() + " " + Integer.toString(numWatch.get());

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/SleepingJob.java
----------------------------------------------------------------------
diff --git a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/SleepingJob.java b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/SleepingJob.java
index 15f86d7..049c193 100644
--- a/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/SleepingJob.java
+++ b/zeppelin-interpreter/src/test/java/org/apache/zeppelin/scheduler/SleepingJob.java
@@ -22,6 +22,8 @@ import java.util.Map;
 
 import org.apache.zeppelin.scheduler.Job;
 import org.apache.zeppelin.scheduler.JobListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SleepingJob extends Job{
 
@@ -30,6 +32,8 @@ public class SleepingJob extends Job{
 	private long start;
 	private int count;
 
+	static Logger LOGGER = LoggerFactory.getLogger(SleepingJob.class);
+
 
 	public SleepingJob(String jobName, JobListener listener, int time){
 		super(jobName, listener);
@@ -44,6 +48,7 @@ public class SleepingJob extends Job{
 			try {
 				Thread.sleep(10);
 			} catch (InterruptedException e) {
+				LOGGER.error("Exception in MockInterpreterAngular while interpret Thread.sleep", e);
 			}
 			if(System.currentTimeMillis() - start>time) break;
 		}

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
index 5401543..e1691ad 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/InterpreterRestApi.java
@@ -110,9 +110,11 @@ public class InterpreterRestApi {
       interpreterFactory.setPropertyAndRestart(settingId,
           new InterpreterOption(true), p.getProperties());
     } catch (InterpreterException e) {
+      logger.error("Exception in InterpreterRestApi while updateSetting ", e);
       return new JsonResponse(
           Status.NOT_FOUND, e.getMessage(), ExceptionUtils.getStackTrace(e)).build();
     } catch (IOException e) {
+      logger.error("Exception in InterpreterRestApi while updateSetting ", e);
       return new JsonResponse(
           Status.INTERNAL_SERVER_ERROR, e.getMessage(), ExceptionUtils.getStackTrace(e)).build();
     }
@@ -144,6 +146,7 @@ public class InterpreterRestApi {
     try {
       interpreterFactory.restart(settingId);
     } catch (InterpreterException e) {
+      logger.error("Exception in InterpreterRestApi while restartSetting ", e);
       return new JsonResponse(
           Status.NOT_FOUND, e.getMessage(), ExceptionUtils.getStackTrace(e)).build();
     }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
index f696b46..7871da8 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/rest/NotebookRestApi.java
@@ -308,6 +308,7 @@ public class NotebookRestApi {
       notebookServer.broadcastNote(note);
       return new JsonResponse(Status.OK, "").build();
     } catch (IndexOutOfBoundsException e) {
+      LOG.error("Exception in NotebookRestApi while moveParagraph ", e);
       return new JsonResponse(Status.BAD_REQUEST, "paragraph's new index is out of bound").build();
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/main/java/org/apache/zeppelin/server/CorsFilter.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/server/CorsFilter.java b/zeppelin-server/src/main/java/org/apache/zeppelin/server/CorsFilter.java
index 0e39242..3fccf1f 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/server/CorsFilter.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/server/CorsFilter.java
@@ -19,12 +19,12 @@ package org.apache.zeppelin.server;
 
 import org.apache.zeppelin.conf.ZeppelinConfiguration;
 import org.apache.zeppelin.utils.SecurityUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import java.io.IOException;
-import java.net.URI;
 import java.net.URISyntaxException;
 import java.text.DateFormat;
-import java.util.Arrays;
 import java.util.Date;
 import java.util.Locale;
 
@@ -43,6 +43,8 @@ import javax.servlet.http.HttpServletResponse;
  */
 public class CorsFilter implements Filter {
 
+  private static final Logger LOGGER = LoggerFactory.getLogger(CorsFilter.class);
+
   @Override
   public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain)
       throws IOException, ServletException {
@@ -54,7 +56,7 @@ public class CorsFilter implements Filter {
         origin = sourceHost;
       }
     } catch (URISyntaxException e) {
-      e.printStackTrace();
+      LOGGER.error("Exception in WebDriverManager while getWebDriver ", e);
     }
 
     if (((HttpServletRequest) request).getMethod().equals("OPTIONS")) {

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
index fd115ee..07aac08 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/server/ZeppelinServer.java
@@ -135,6 +135,7 @@ public class ZeppelinServer extends Application {
       try {
         System.in.read();
       } catch (IOException e) {
+        LOG.error("Exception in ZeppelinServer while main ", e);
       }
       System.exit(0);
     }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
index 8dfb295..038aff1 100644
--- a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
+++ b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookServer.java
@@ -71,9 +71,9 @@ public class NotebookServer extends WebSocketServlet implements
     try {
       return SecurityUtils.isValidOrigin(origin, ZeppelinConfiguration.create());
     } catch (UnknownHostException e) {
-      e.printStackTrace();
+      LOG.error(e.toString(), e);
     } catch (URISyntaxException e) {
-      e.printStackTrace();
+      LOG.error(e.toString(), e);
     }
     return false;
   }
@@ -772,7 +772,7 @@ public class NotebookServer extends WebSocketServlet implements
         try {
           note.persist();
         } catch (IOException e) {
-          e.printStackTrace();
+          LOG.error(e.toString(), e);
         }
       }
       notebookServer.broadcastNote(note);

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java b/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java
index e2c633b..edb4ac9 100644
--- a/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java
+++ b/zeppelin-server/src/test/java/com/webautomation/ScreenCaptureHtmlUnitDriver.java
@@ -50,6 +50,8 @@ import com.gargoylesoftware.htmlunit.WebRequest;
 import com.gargoylesoftware.htmlunit.WebWindow;
 import com.gargoylesoftware.htmlunit.html.HtmlElement;
 import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * from https://code.google.com/p/selenium/issues/detail?id=1361
@@ -63,6 +65,8 @@ public class ScreenCaptureHtmlUnitDriver extends HtmlUnitDriver implements Takes
     // http://stackoverflow.com/questions/4652777/java-regex-to-get-the-urls-from-css
     private final static Pattern cssUrlPattern = Pattern.compile("background(-image)?[\\s]*:[^url]*url[\\s]*\\([\\s]*([^\\)]*)[\\s]*\\)[\\s]*");// ?<url>
 
+    static Logger LOGGER = LoggerFactory.getLogger(ScreenCaptureHtmlUnitDriver.class);
+
     public ScreenCaptureHtmlUnitDriver() {
         super();
     }
@@ -88,6 +92,7 @@ public class ScreenCaptureHtmlUnitDriver extends HtmlUnitDriver implements Takes
         try {
             archive = downloadCssAndImages(getWebClient(), (HtmlPage) getCurrentWindow().getEnclosedPage());
         } catch (Exception e) {
+            LOGGER.error("Exception in ScreenCaptureHtmlUnitDriver while getScreenshotAs ", e);
         }
         if(target.equals(OutputType.BASE64)){
             return target.convertFromBase64Png(new Base64Encoder().encode(archive));
@@ -116,6 +121,7 @@ public class ScreenCaptureHtmlUnitDriver extends HtmlUnitDriver implements Takes
             window = webClient.getWebWindowByName(page.getUrl().toString()+"_screenshot");
             webClient.getPage(window, new WebRequest(page.getUrl()));
         } catch (Exception e) {
+            LOGGER.error("Exception in ScreenCaptureHtmlUnitDriver while downloadCssAndImages ", e);
             window = webClient.openWindow(page.getUrl(), page.getUrl().toString()+"_screenshot");
         }
 
@@ -148,6 +154,7 @@ public class ScreenCaptureHtmlUnitDriver extends HtmlUnitDriver implements Takes
                             .replace("resources/", "./").getBytes());
                 }
             } catch (Exception e) {
+                LOGGER.error("Exception in ScreenCaptureHtmlUnitDriver while resultList.iterator ", e);
             }
         }
         String pagesrc = replaceRemoteUrlsWithLocal(page.getWebResponse().getContentAsString(), urlMapping);

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/org/apache/zeppelin/ProcessData.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/ProcessData.java b/zeppelin-server/src/test/java/org/apache/zeppelin/ProcessData.java
index d1e0d5c..83f5f4c 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/ProcessData.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/ProcessData.java
@@ -233,6 +233,7 @@ public class ProcessData {
             String exceptionAsString = sw.toString();
             LOG.error(exceptionAsString);
           } catch (Exception ignore) {
+            LOG.info("Exception in ProcessData while buildOutputAndErrorStreamData ", ignore);
           }
           break;
         }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/org/apache/zeppelin/WebDriverManager.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/WebDriverManager.java b/zeppelin-server/src/test/java/org/apache/zeppelin/WebDriverManager.java
index 5b0b199..d899d57 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/WebDriverManager.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/WebDriverManager.java
@@ -85,6 +85,7 @@ public class WebDriverManager {
 
         driver = new FirefoxDriver(ffox, profile);
       } catch (Exception e) {
+        LOG.error("Exception in WebDriverManager while FireFox Driver ", e);
       }
     }
 
@@ -92,6 +93,7 @@ public class WebDriverManager {
       try {
         driver = new ChromeDriver();
       } catch (Exception e) {
+        LOG.error("Exception in WebDriverManager while ChromeDriver ", e);
       }
     }
 
@@ -99,6 +101,7 @@ public class WebDriverManager {
       try {
         driver = new SafariDriver();
       } catch (Exception e) {
+        LOG.error("Exception in WebDriverManager while SafariDriver ", e);
       }
     }
 
@@ -126,6 +129,7 @@ public class WebDriverManager {
         loaded = true;
         break;
       } catch (TimeoutException e) {
+        LOG.info("Exception in WebDriverManager while WebDriverWait ", e);
         driver.navigate().to(url);
       }
     }
@@ -164,7 +168,6 @@ public class WebDriverManager {
 
     } catch (IOException e) {
       LOG.error("Download of firebug version: " + firefoxVersion + ", falied in path " + tempPath);
-      LOG.error(e.toString());
     }
     LOG.info("Download of firebug version: " + firefoxVersion + ", successful");
   }
@@ -178,7 +181,7 @@ public class WebDriverManager {
       String versionString = (String) CommandExecutor.executeCommandLocalHost(firefoxVersionCmd, false, ProcessData.Types_Of_Data.OUTPUT);
       return Integer.valueOf(versionString.replaceAll("Mozilla Firefox", "").trim().substring(0, 2));
     } catch (Exception e) {
-      e.printStackTrace();
+      LOG.error("Exception in WebDriverManager while getWebDriver ", e);
       return -1;
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
index 6b464dd..49c58b5 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinIT.java
@@ -101,6 +101,7 @@ public class ZeppelinIT {
       WebElement element = pollingWait(locator, MAX_BROWSER_TIMEOUT_SEC);
       return txt.equals(element.getText());
     } catch (TimeoutException e) {
+      LOG.error("Exception in ZeppelinIT while waitForText ", e);
       return false;
     }
   }
@@ -255,6 +256,7 @@ public class ZeppelinIT {
 
       System.out.println("testCreateNotebook Test executed");
     } catch (ElementNotVisibleException e) {
+      LOG.error("Exception in ZeppelinIT while testAngularDisplay ", e);
       File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
 
     }
@@ -279,6 +281,7 @@ public class ZeppelinIT {
     try {
       Thread.sleep(500); // wait for notebook list updated
     } catch (InterruptedException e) {
+      LOG.error("Exception in ZeppelinIT while createNewNote Thread.sleep", e);
     }
   }
 }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinITUtils.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinITUtils.java b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinITUtils.java
index 2fa6806..9800df6 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinITUtils.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/ZeppelinITUtils.java
@@ -33,7 +33,7 @@ public class ZeppelinITUtils {
     try {
       Thread.sleep(millis);
     } catch (InterruptedException e) {
-      e.printStackTrace();
+      LOG.error("Exception in WebDriverManager while getWebDriver ", e);
     }
     if (logOutput) {
       LOG.info("Finished.");

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java
index 69d1022..0c4199d 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/AbstractTestRestApi.java
@@ -55,7 +55,7 @@ public abstract class AbstractTestRestApi {
 
   static final String restApiUrl = "/api";
   static final String url = getUrlToTest();
-  protected static final boolean wasRunning = checkIfServerIsRuning();
+  protected static final boolean wasRunning = checkIfServerIsRunning();
   static boolean pySpark = false;
 
   private String getUrl(String path) {
@@ -86,7 +86,7 @@ public abstract class AbstractTestRestApi {
       try {
         ZeppelinServer.main(new String[] {""});
       } catch (Exception e) {
-        e.printStackTrace();
+        LOG.error("Exception in WebDriverManager while getWebDriver ", e);
         throw new RuntimeException(e);
       }
     }
@@ -101,7 +101,7 @@ public abstract class AbstractTestRestApi {
       boolean started = false;
       while (System.currentTimeMillis() - s < 1000 * 60 * 3) {  // 3 minutes
         Thread.sleep(2000);
-        started = checkIfServerIsRuning();
+        started = checkIfServerIsRunning();
         if (started == true) {
           break;
         }
@@ -156,7 +156,7 @@ public abstract class AbstractTestRestApi {
     try {
       return InetAddress.getLocalHost().getHostName();
     } catch (UnknownHostException e) {
-      e.printStackTrace();
+      LOG.error("Exception in WebDriverManager while getWebDriver ", e);
       return "localhost";
     }
   }
@@ -218,7 +218,7 @@ public abstract class AbstractTestRestApi {
       boolean started = true;
       while (System.currentTimeMillis() - s < 1000 * 60 * 3) {  // 3 minutes
         Thread.sleep(2000);
-        started = checkIfServerIsRuning();
+        started = checkIfServerIsRunning();
         if (started == false) {
           break;
         }
@@ -231,13 +231,14 @@ public abstract class AbstractTestRestApi {
     }
   }
 
-  protected static boolean checkIfServerIsRuning() {
+  protected static boolean checkIfServerIsRunning() {
     GetMethod request = null;
     boolean isRunning = true;
     try {
       request = httpGet("/");
       isRunning = request.getStatusCode() == 200;
     } catch (IOException e) {
+      LOG.error("Exception in AbstractTestRestApi while checkIfServerIsRunning ", e);
       isRunning = false;
     } finally {
       if (request != null) {
@@ -343,6 +344,7 @@ public abstract class AbstractTestRestApi {
         try {
           new JsonParser().parse(body);
         } catch (JsonParseException e) {
+          LOG.error("Exception in AbstractTestRestApi while matchesSafely ", e);
           isValid = false;
         }
         return isValid;

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinSparkClusterTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinSparkClusterTest.java b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinSparkClusterTest.java
index ffe5d54..5a489fa 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinSparkClusterTest.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/rest/ZeppelinSparkClusterTest.java
@@ -60,7 +60,7 @@ public class ZeppelinSparkClusterTest extends AbstractTestRestApi {
       try {
         Thread.sleep(100);
       } catch (InterruptedException e) {
-        e.printStackTrace();
+        LOG.error("Exception in WebDriverManager while getWebDriver ", e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java b/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
index 67d12b7..8ec7bdd 100644
--- a/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
+++ b/zeppelin-server/src/test/java/org/apache/zeppelin/socket/NotebookServerTest.java
@@ -19,10 +19,7 @@
  */
 package org.apache.zeppelin.socket;
 
-import static org.junit.Assert.*;
-
-import java.io.IOException;
-
+import com.google.gson.Gson;
 import org.apache.zeppelin.interpreter.InterpreterGroup;
 import org.apache.zeppelin.interpreter.InterpreterSetting;
 import org.apache.zeppelin.notebook.Note;
@@ -34,14 +31,13 @@ import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-import com.google.gson.Gson;
-
-import java.net.UnknownHostException;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
 import java.net.InetAddress;
+import java.net.UnknownHostException;
 import java.util.List;
 
-import javax.servlet.http.HttpServletRequest;
-
+import static org.junit.Assert.*;
 import static org.mockito.Mockito.*;
 
 
@@ -149,6 +145,8 @@ public class NotebookServerTest extends AbstractTestRestApi {
       note = notebookServer.importNote(null, notebook, messageReceived);
     } catch (NullPointerException e) {
       //broadcastNoteList(); failed nothing to worry.
+      LOG.error("Exception in NotebookServerTest while testImportNotebook, failed nothing to " +
+          "worry ", e);
     }
 
     assertNotEquals(null, notebook.getNote(note.getId()));

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
index 8c41c95..6efc2a3 100755
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java
@@ -565,6 +565,7 @@ public class ZeppelinConfiguration extends XMLConfiguration {
         try {
           checkType(value);
         } catch (Exception e) {
+          LOG.error("Exception in ZeppelinConfiguration while isType", e);
           return false;
         }
         return true;

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
index 9591a7f..fc8cc04 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
@@ -17,29 +17,8 @@
 
 package org.apache.zeppelin.interpreter;
 
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.NullArgumentException;
 import org.apache.zeppelin.conf.ZeppelinConfiguration;
@@ -54,8 +33,13 @@ import org.apache.zeppelin.scheduler.Job.Status;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
+import java.io.*;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.*;
 
 /**
  * Manage interpreters.

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
index 6d08e7b..a068cea 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/Notebook.java
@@ -58,7 +58,7 @@ import org.slf4j.LoggerFactory;
  * Collection of Notes.
  */
 public class Notebook {
-  Logger logger = LoggerFactory.getLogger(Notebook.class);
+  static Logger logger = LoggerFactory.getLogger(Notebook.class);
 
   @SuppressWarnings("unused") @Deprecated //TODO(bzz): remove unused
   private SchedulerFactory schedulerFactory;
@@ -237,7 +237,7 @@ public class Notebook {
     try {
       note.unpersist();
     } catch (IOException e) {
-      e.printStackTrace();
+      logger.error(e.toString(), e);
     }
   }
 
@@ -420,7 +420,7 @@ public class Notebook {
         try {
           Thread.sleep(1000);
         } catch (InterruptedException e) {
-          e.printStackTrace();
+          logger.error(e.toString(), e);
         }
       }
       
@@ -428,7 +428,7 @@ public class Notebook {
       try {
         releaseResource = (boolean) note.getConfig().get("releaseresource");
       } catch (java.lang.ClassCastException e) {
-        e.printStackTrace();
+        logger.error(e.toString(), e);
       }
       if (releaseResource) {
         for (InterpreterSetting setting : note.getNoteReplLoader().getInterpreterSettings()) {

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
index eedc066..917ea6b 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/NotebookTest.java
@@ -130,7 +130,7 @@ public class NotebookTest implements JobListenerFactory{
     try {
       FileUtils.copyDirectory(srcDir, destDir);
     } catch (IOException e) {
-      e.printStackTrace();
+      logger.error(e.toString(), e);
     }
 
     // doesn't have copied notebook in memory before reloading

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java
index 4bcbccb..4e9e180 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/NotebookRepoSyncTest.java
@@ -199,7 +199,7 @@ public class NotebookRepoSyncTest implements JobListenerFactory {
     try {
       FileUtils.copyDirectory(srcDir, destDir);
     } catch (IOException e) {
-      e.printStackTrace();
+      LOG.error(e.toString(), e);
     }
     assertEquals(0, notebookRepoSync.list(0).size());
     assertEquals(1, notebookRepoSync.list(1).size());

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java
index 80d1174..65be61b 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/notebook/repo/VFSNotebookRepoTest.java
@@ -134,7 +134,7 @@ public class VFSNotebookRepoTest implements JobListenerFactory {
       try {
         notebookRepo.save(note);
       } catch (IOException e) {
-        e.printStackTrace();
+        LOG.error(e.toString(), e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/ff99ecba/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilsForTests.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilsForTests.java b/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilsForTests.java
index 7700d19..22002ee 100644
--- a/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilsForTests.java
+++ b/zeppelin-zengine/src/test/java/org/apache/zeppelin/util/UtilsForTests.java
@@ -17,6 +17,9 @@
 
 package org.apache.zeppelin.util;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -27,13 +30,15 @@ import java.util.Map;
 
 public class UtilsForTests {
 
-	public static File createTmpDir() throws Exception {
-		File tmpDir = new File(System.getProperty("java.io.tmpdir")+"/ZeppelinLTest_"+System.currentTimeMillis());
-		tmpDir.mkdir();
-		return tmpDir;
+  static Logger LOGGER = LoggerFactory.getLogger(UtilsForTests.class);
 
-	}
-	/*
+  public static File createTmpDir() throws Exception {
+    File tmpDir = new File(System.getProperty("java.io.tmpdir") + "/ZeppelinLTest_" + System.currentTimeMillis());
+    tmpDir.mkdir();
+    return tmpDir;
+
+  }
+  /*
 	private static final String HADOOP_DIST="http://apache.mirror.cdnetworks.com/hadoop/common/hadoop-1.2.1/hadoop-1.2.1-bin.tar.gz";
 	//private static final String HADOOP_DIST="http://www.us.apache.org/dist/hadoop/common/hadoop-1.2.1/hadoop-1.2.1-bin.tar.gz";
 
@@ -48,72 +53,72 @@ public class UtilsForTests {
 	}
 	*/
 
-	public static void delete(File file){
-		if(file.isFile()) file.delete();
-		else if(file.isDirectory()){
-			File [] files = file.listFiles();
-			if(files!=null && files.length>0){
-				for(File f : files){
-					delete(f);
-				}
-			}
-			file.delete();
-		}
-	}
-
-    /**
-     * Utility method to create a file (if does not exist) and populate it the the given content
-     *
-     * @param path to file
-     * @param content of the file
-     * @throws IOException
-     */
-    public static void createFileWithContent(String path, String content) throws IOException {
-        File f = new File(path);
-        if (!f.exists()) {
-            stringToFile(content, f);
+  public static void delete(File file) {
+    if (file.isFile()) file.delete();
+    else if (file.isDirectory()) {
+      File[] files = file.listFiles();
+      if (files != null && files.length > 0) {
+        for (File f : files) {
+          delete(f);
         }
+      }
+      file.delete();
     }
+  }
 
-	public static void stringToFile(String string, File file) throws IOException{
-		FileOutputStream out = new FileOutputStream(file);
-		out.write(string.getBytes());
-		out.close();
-	}
+  /**
+   * Utility method to create a file (if does not exist) and populate it the the given content
+   *
+   * @param path    to file
+   * @param content of the file
+   * @throws IOException
+   */
+  public static void createFileWithContent(String path, String content) throws IOException {
+    File f = new File(path);
+    if (!f.exists()) {
+      stringToFile(content, f);
+    }
+  }
 
-	@SuppressWarnings({ "unchecked", "rawtypes" })
-	public static void setEnv(String k, String v) {
-		Map<String, String> newenv = new HashMap<String, String>();
-		newenv.put(k, v);
-	  try {
-	        Class<?> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
-	        Field theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment");
-	        theEnvironmentField.setAccessible(true);
-            Map<String, String> env = (Map<String, String>) theEnvironmentField.get(null);
-	        env.putAll(newenv);
-	        Field theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
-	        theCaseInsensitiveEnvironmentField.setAccessible(true);
-	        Map<String, String> cienv = (Map<String, String>)     theCaseInsensitiveEnvironmentField.get(null);
-	        cienv.putAll(newenv);
-	  } catch (NoSuchFieldException e) {
-	      try {
-	        Class[] classes = Collections.class.getDeclaredClasses();
-	        Map<String, String> env = System.getenv();
-	        for(Class cl : classes) {
-	            if("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
-	                Field field = cl.getDeclaredField("m");
-	                field.setAccessible(true);
-	                Object obj = field.get(env);
-	                Map<String, String> map = (Map<String, String>) obj;
-	                map.clear();
-	                map.putAll(newenv);
-	            }
-	        }
-	      } catch (Exception e2) {
-	        e2.printStackTrace();
-	      }
-	    } catch (Exception e1) {
-	        e1.printStackTrace();
-	    }
-	}
+  public static void stringToFile(String string, File file) throws IOException {
+    FileOutputStream out = new FileOutputStream(file);
+    out.write(string.getBytes());
+    out.close();
+  }
+
+  @SuppressWarnings({"unchecked", "rawtypes"})
+  public static void setEnv(String k, String v) {
+    Map<String, String> newenv = new HashMap<String, String>();
+    newenv.put(k, v);
+    try {
+      Class<?> processEnvironmentClass = Class.forName("java.lang.ProcessEnvironment");
+      Field theEnvironmentField = processEnvironmentClass.getDeclaredField("theEnvironment");
+      theEnvironmentField.setAccessible(true);
+      Map<String, String> env = (Map<String, String>) theEnvironmentField.get(null);
+      env.putAll(newenv);
+      Field theCaseInsensitiveEnvironmentField = processEnvironmentClass.getDeclaredField("theCaseInsensitiveEnvironment");
+      theCaseInsensitiveEnvironmentField.setAccessible(true);
+      Map<String, String> cienv = (Map<String, String>) theCaseInsensitiveEnvironmentField.get(null);
+      cienv.putAll(newenv);
+    } catch (NoSuchFieldException e) {
+      try {
+        Class[] classes = Collections.class.getDeclaredClasses();
+        Map<String, String> env = System.getenv();
+        for (Class cl : classes) {
+          if ("java.util.Collections$UnmodifiableMap".equals(cl.getName())) {
+            Field field = cl.getDeclaredField("m");
+            field.setAccessible(true);
+            Object obj = field.get(env);
+            Map<String, String> map = (Map<String, String>) obj;
+            map.clear();
+            map.putAll(newenv);
+          }
+        }
+      } catch (Exception e2) {
+        LOGGER.error(e2.toString(), e2);
+      }
+    } catch (Exception e1) {
+      LOGGER.error(e1.toString(), e1);
+    }
+  }
 }


Mime
View raw message