|
@@ -20,6 +20,10 @@ public class CanalLauncher {
|
|
|
|
|
|
public static void main(String[] args) throws Throwable {
|
|
|
try {
|
|
|
+ logger.info("## set default uncaught exception handler");
|
|
|
+ setGlobalUncaughtExceptionHandler();
|
|
|
+
|
|
|
+ logger.info("## load canal configurations");
|
|
|
String conf = System.getProperty("canal.conf", "classpath:canal.properties");
|
|
|
Properties properties = new Properties();
|
|
|
if (conf.startsWith(CLASSPATH_URL_PREFIX)) {
|
|
@@ -52,4 +56,13 @@ public class CanalLauncher {
|
|
|
System.exit(0);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private static void setGlobalUncaughtExceptionHandler() {
|
|
|
+ Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
|
|
|
+ @Override
|
|
|
+ public void uncaughtException(Thread t, Throwable e) {
|
|
|
+ logger.error("UnCaughtException", e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|