|
@@ -91,11 +91,13 @@ public class JobThread extends Thread{
|
91
|
91
|
if (toStop) {
|
92
|
92
|
XxlJobLogger.log("<br>----------- xxl-job toStop, stopReason:" + stopReason);
|
93
|
93
|
}
|
94
|
|
- logger.error("JobThread Exception:", e);
|
95
|
|
- StringWriter out = new StringWriter();
|
96
|
|
- e.printStackTrace(new PrintWriter(out));
|
97
|
94
|
|
98
|
|
- executeResult = new ReturnT<String>(ReturnT.FAIL_CODE, out.toString());
|
|
95
|
+ StringWriter stringWriter = new StringWriter();
|
|
96
|
+ e.printStackTrace(new PrintWriter(stringWriter));
|
|
97
|
+ String errorMsg = stringWriter.toString();
|
|
98
|
+ XxlJobLogger.log("JobThread Exception:" + errorMsg);
|
|
99
|
+
|
|
100
|
+ executeResult = new ReturnT<String>(ReturnT.FAIL_CODE, stringWriter.toString());
|
99
|
101
|
}
|
100
|
102
|
|
101
|
103
|
XxlJobLogger.log("----------- xxl-job job execute end ----------- <br> " +
|
|
@@ -117,10 +119,7 @@ public class JobThread extends Thread{
|
117
|
119
|
}
|
118
|
120
|
|
119
|
121
|
StringWriter stringWriter = new StringWriter();
|
120
|
|
- PrintWriter printWriter = new PrintWriter(stringWriter, true);
|
121
|
|
- e.printStackTrace(printWriter);
|
122
|
|
- printWriter.flush();
|
123
|
|
- stringWriter.flush();
|
|
122
|
+ e.printStackTrace(new PrintWriter(stringWriter));
|
124
|
123
|
String errorMsg = stringWriter.toString();
|
125
|
124
|
XxlJobLogger.log("----------- xxl-job JobThread Exception:" + errorMsg);
|
126
|
125
|
}
|