You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ab...@apache.org on 2014/11/13 23:30:04 UTC
sqoop git commit: SQOOP-1727: Sqoop2: Log server initialization
errors to log4j
Repository: sqoop
Updated Branches:
refs/heads/sqoop2 8c33cdd98 -> a8298c13a
SQOOP-1727: Sqoop2: Log server initialization errors to log4j
(Vinoth Chandar via Abraham Elmahrek)
Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/a8298c13
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/a8298c13
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/a8298c13
Branch: refs/heads/sqoop2
Commit: a8298c13ac7b285e2ef95415af5502d5db6a29d3
Parents: 8c33cdd
Author: Abraham Elmahrek <ab...@elmahrek.com>
Authored: Thu Nov 13 14:23:05 2014 -0800
Committer: Abraham Elmahrek <ab...@elmahrek.com>
Committed: Thu Nov 13 14:23:05 2014 -0800
----------------------------------------------------------------------
.../main/java/org/apache/sqoop/server/ServerInitializer.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/sqoop/blob/a8298c13/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java
----------------------------------------------------------------------
diff --git a/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java b/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java
index a150e3a..48963f3 100644
--- a/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java
+++ b/server/src/main/java/org/apache/sqoop/server/ServerInitializer.java
@@ -17,6 +17,7 @@
*/
package org.apache.sqoop.server;
+import org.apache.log4j.Logger;
import org.apache.sqoop.core.ConfigurationConstants;
import org.apache.sqoop.core.SqoopServer;
@@ -29,6 +30,8 @@ import javax.servlet.ServletContextListener;
*/
public class ServerInitializer implements ServletContextListener {
+ private static final Logger LOG = Logger.getLogger(ServerInitializer.class);
+
public void contextDestroyed(ServletContextEvent arg0) {
SqoopServer.destroy();
}
@@ -40,12 +43,11 @@ public class ServerInitializer implements ServletContextListener {
// We are assuming that by default we are running as the only app inside
// the tomcat and hence we want to try kill entire tomcat on our load failure.
if("true".equals(System.getProperty(ConfigurationConstants.KILL_TOMCAT_ON_FAILURE, "true"))) {
- System.out.println("Sqoop failed to load:");
- ex.printStackTrace(System.out);
+ LOG.error("Sqoop server failed to start", ex);
System.exit(1);
}
- throw new RuntimeException("Sqoop server failed to load.", ex);
+ throw new RuntimeException("Sqoop server failed to start.", ex);
}
}
}