新特性:

- 1、IP工具类获取IP逻辑优化,IP静态缓存;
- 2、执行器、调度中心,均支持自定义注册IP地址;解决机器多网卡时错误网卡注册的情况;
- 3、任务跨天执行时生成多份日志文件的问题修复;
v1.5
xueli.xue 8 years ago
parent ce8d9302de
commit 6b91f40889

@ -705,8 +705,10 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 5、已推送V1.5.0和V1.5.1至Maven中央仓库
#### 6.10 版本 V1.5.2 特性
- 1、IP工具类优化IP静态缓存
- 2、执行器、调度中心支持自定义注册IP地址解决机器多网卡时错误网卡注册的情况
- 1、IP工具类获取IP逻辑优化IP静态缓存
- 2、执行器、调度中心均支持自定义注册IP地址解决机器多网卡时错误网卡注册的情况
- 3、任务跨天执行时生成多份日志文件的问题修复
#### 规划中
- 1、集群执行器选择规则自定义单点=选择第一个,随机=随机选择一个;
@ -717,11 +719,12 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
Pass后续调度被Pass
- 4、后续优化在线修改密码
- 5、兼容oracle
- 6、跨天日志write问题修复
- 7、rolling日志
- 8、执行器server启动注册逻辑调整
- 9、通过listener或stop方法容器销毁时销毁线程Daemon方式有时不太理想
- 10、调度重试机制
- 6、rolling日志
- 7、执行器server启动注册逻辑调整
- 8、通过listener或stop方法容器销毁时销毁线程Daemon方式有时不太理想
- 9、调度重试机制
- 10、报表当日报表、一周报表、一年报表等等
- 11、通讯hex 通讯调整为 http-rpc 模式;
## 七、其他

@ -52,6 +52,9 @@ public class RemoteHttpJobBean extends QuartzJobBean {
}
adminAddressSet.add(DynamicSchedulerUtil.getCallbackAddress());
// update trigger info 1/2
jobLog.setTriggerTime(new Date());
// trigger request
RequestModel requestModel = new RequestModel();
requestModel.setTimestamp(System.currentTimeMillis());
@ -63,6 +66,7 @@ public class RemoteHttpJobBean extends QuartzJobBean {
requestModel.setGlueSwitch((jobInfo.getGlueSwitch()==0)?false:true);
requestModel.setLogAddress(adminAddressSet);
requestModel.setLogId(jobLog.getId());
requestModel.setLogDateTim(jobLog.getTriggerTime().getTime());
// parse address
List<String> addressList = new ArrayList<String>();
@ -77,8 +81,7 @@ public class RemoteHttpJobBean extends QuartzJobBean {
jobLog.setExecutorParam(jobInfo.getExecutorParam());
logger.info(">>>>>>>>>>> xxl-job failoverTrigger response, jobId:{}, responseModel:{}", jobLog.getId(), responseModel.toString());
// update trigger info
jobLog.setTriggerTime(new Date());
// update trigger info 2/2
jobLog.setTriggerStatus(responseModel.getStatus());
jobLog.setTriggerMsg(responseModel.getMsg());
DynamicSchedulerUtil.xxlJobLogDao.updateTriggerInfo(jobLog);

@ -23,30 +23,43 @@ public class XxlJobFileAppender extends AppenderSkeleton {
public void setFilePath(String filePath) {
XxlJobFileAppender.filePath = filePath;
}
/**
* log filename: yyyy-MM-dd/9999.log
*
* @param triggerDate
* @param logId
* @return
*/
public static String makeLogFileName(Date triggerDate, int logId) {
// filePath/
File filePathDir = new File(filePath);
if (!filePathDir.exists()) {
filePathDir.mkdirs();
}
// filePath/yyyy-MM-dd/
String nowFormat = sdf.format(new Date());
File filePathDateDir = new File(filePathDir, nowFormat);
if (!filePathDateDir.exists()) {
filePathDateDir.mkdirs();
}
// filePath/yyyy-MM-dd/9999.log
String logFileName = XxlJobFileAppender.sdf.format(triggerDate).concat("/").concat(String.valueOf(logId)).concat(".log");
return logFileName;
}
@Override
protected void append(LoggingEvent event) {
String trigger_log_id = contextHolder.get();
if (trigger_log_id==null || trigger_log_id.trim().length()==0) {
String logFileName = contextHolder.get();
if (logFileName==null || logFileName.trim().length()==0) {
return;
}
// filePath/
File filePathDir = new File(filePath);
if (!filePathDir.exists()) {
filePathDir.mkdirs();
}
// filePath/yyyy-MM-dd/
String nowFormat = sdf.format(new Date());
File filePathDateDir = new File(filePathDir, nowFormat);
if (!filePathDateDir.exists()) {
filePathDateDir.mkdirs();
}
// filePath/yyyy-MM-dd/9999.log
String logFileName = trigger_log_id.concat(".log");
File logFile = new File(filePathDateDir, logFileName);
File logFile = new File(filePath, logFileName);
if (!logFile.exists()) {
try {
logFile.createNewFile();
@ -101,31 +114,16 @@ public class XxlJobFileAppender extends AppenderSkeleton {
/**
* support read log-file
* @param triggerDate
* @param trigger_log_id
* @param logFileName
* @return log content
*/
public static String readLog(Date triggerDate, int trigger_log_id ){
if (triggerDate==null || trigger_log_id<=0) {
public static String readLog(String logFileName ){
if (logFileName==null || logFileName.trim().length()==0) {
return null;
}
// filePath/
File filePathDir = new File(filePath);
if (!filePathDir.exists()) {
filePathDir.mkdirs();
}
// filePath/yyyy-MM-dd/
String nowFormat = sdf.format(triggerDate);
File filePathDateDir = new File(filePathDir, nowFormat);
if (!filePathDateDir.exists()) {
filePathDateDir.mkdirs();
}
// filePath/yyyy-MM-dd/9999.log
String logFileName = String.valueOf(trigger_log_id).concat(".log");
File logFile = new File(filePathDateDir, logFileName);
File logFile = new File(filePath, logFileName);
if (!logFile.exists()) {
return null;
}

@ -14,7 +14,10 @@ public class LogAction extends IAction {
@Override
public ResponseModel execute(RequestModel requestModel) {
String logConteng = XxlJobFileAppender.readLog(new Date(requestModel.getLogDateTim()), requestModel.getLogId());
// log filename: yyyy-MM-dd/9999.log
String logFileName = XxlJobFileAppender.makeLogFileName(new Date(requestModel.getLogDateTim()), requestModel.getLogId());
String logConteng = XxlJobFileAppender.readLog(logFileName);
return new ResponseModel(ResponseModel.SUCCESS, logConteng);
}

@ -11,6 +11,7 @@ import org.slf4j.LoggerFactory;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.Date;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
@ -78,7 +79,10 @@ public class JobThread extends Thread{
String _msg = null;
try {
XxlJobFileAppender.contextHolder.set(String.valueOf(triggerDate.getLogId()));
// log filename: yyyy-MM-dd/9999.log
String logFileName = XxlJobFileAppender.makeLogFileName(new Date(triggerDate.getLogDateTim()), triggerDate.getLogId());
XxlJobFileAppender.contextHolder.set(logFileName);
logger.info("----------- xxl-job job handle start -----------");
handler.execute(handlerParams);
} catch (Exception e) {

Loading…
Cancel
Save