|
|
@@ -12,6 +12,8 @@ import com.xxl.job.core.biz.model.ReturnT;
|
|
12
|
12
|
import com.xxl.job.core.rpc.netcom.NetComClientProxy;
|
|
13
|
13
|
import org.apache.commons.lang.StringUtils;
|
|
14
|
14
|
import org.apache.commons.lang.time.DateUtils;
|
|
|
15
|
+import org.slf4j.Logger;
|
|
|
16
|
+import org.slf4j.LoggerFactory;
|
|
15
|
17
|
import org.springframework.stereotype.Controller;
|
|
16
|
18
|
import org.springframework.ui.Model;
|
|
17
|
19
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -32,6 +34,7 @@ import java.util.Map;
|
|
32
|
34
|
@Controller
|
|
33
|
35
|
@RequestMapping("/joblog")
|
|
34
|
36
|
public class JobLogController {
|
|
|
37
|
+ private static Logger logger = LoggerFactory.getLogger(JobLogController.class);
|
|
35
|
38
|
|
|
36
|
39
|
@Resource
|
|
37
|
40
|
private XxlJobGroupDao xxlJobGroupDao;
|
|
|
@@ -129,7 +132,7 @@ public class JobLogController {
|
|
129
|
132
|
|
|
130
|
133
|
return logResult;
|
|
131
|
134
|
} catch (Exception e) {
|
|
132
|
|
- e.printStackTrace();
|
|
|
135
|
+ logger.error(e.getMessage(), e);
|
|
133
|
136
|
return new ReturnT<LogResult>(ReturnT.FAIL_CODE, e.getMessage());
|
|
134
|
137
|
}
|
|
135
|
138
|
}
|
|
|
@@ -148,14 +151,14 @@ public class JobLogController {
|
|
148
|
151
|
}
|
|
149
|
152
|
|
|
150
|
153
|
// request of kill
|
|
151
|
|
- ExecutorBiz executorBiz = null;
|
|
|
154
|
+ ReturnT<String> runResult = null;
|
|
152
|
155
|
try {
|
|
153
|
|
- executorBiz = (ExecutorBiz) new NetComClientProxy(ExecutorBiz.class, log.getExecutorAddress()).getObject();
|
|
|
156
|
+ ExecutorBiz executorBiz = (ExecutorBiz) new NetComClientProxy(ExecutorBiz.class, log.getExecutorAddress()).getObject();
|
|
|
157
|
+ runResult = executorBiz.kill(jobInfo.getId());
|
|
154
|
158
|
} catch (Exception e) {
|
|
155
|
|
- e.printStackTrace();
|
|
156
|
|
- return new ReturnT<String>(500, e.getMessage());
|
|
|
159
|
+ logger.error(e.getMessage(), e);
|
|
|
160
|
+ runResult = new ReturnT<String>(500, e.getMessage());
|
|
157
|
161
|
}
|
|
158
|
|
- ReturnT<String> runResult = executorBiz.kill(jobInfo.getId());
|
|
159
|
162
|
|
|
160
|
163
|
if (ReturnT.SUCCESS_CODE == runResult.getCode()) {
|
|
161
|
164
|
log.setHandleCode(ReturnT.FAIL_CODE);
|