From 5c24778f3d4aea0cdc2f9a7bf424f59954676a99 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Tue, 15 May 2018 20:51:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=84=9A=E6=9C=AC=E4=BB=BB=E5=8A=A1=E5=BC=82?= =?UTF-8?q?=E5=B8=B8Log=E8=BE=93=E5=87=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 1 + .../src/main/java/com/xxl/job/core/util/ScriptUtil.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index 318f5a62..e44223ed 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1200,6 +1200,7 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段 - 9、任务日志查询速度优化,百万级别日志量搜索速度提升1000倍; - 10、底层LocalCache组件兼容性优化,支持jdk、jdk10编译部署; - 11、[迭代中]回调log优化,支持展示在rolling log中,方便排查问题; +- 12、脚本任务异常Log输出优化; ### TODO LIST diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/util/ScriptUtil.java b/xxl-job-core/src/main/java/com/xxl/job/core/util/ScriptUtil.java index 4f0f3631..734d50fd 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/util/ScriptUtil.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/util/ScriptUtil.java @@ -1,5 +1,6 @@ package com.xxl.job.core.util; +import com.xxl.job.core.log.XxlJobLogger; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.DefaultExecutor; import org.apache.commons.exec.PumpStreamHandler; @@ -75,6 +76,9 @@ public class ScriptUtil { exec.setStreamHandler(streamHandler); int exitValue = exec.execute(commandline); // exit code: 0=success, 1=error return exitValue; + } catch (Exception e) { + XxlJobLogger.log(e); + return -1; } }