底层日志底层日志调整,非敏感日志level调整为debug;

v1.5
xueli.xue 8 years ago
parent 6b91f40889
commit 859207d05e

@ -708,6 +708,8 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
- 1、IP工具类获取IP逻辑优化IP静态缓存 - 1、IP工具类获取IP逻辑优化IP静态缓存
- 2、执行器、调度中心均支持自定义注册IP地址解决机器多网卡时错误网卡注册的情况 - 2、执行器、调度中心均支持自定义注册IP地址解决机器多网卡时错误网卡注册的情况
- 3、任务跨天执行时生成多份日志文件的问题修复 - 3、任务跨天执行时生成多份日志文件的问题修复
- 4、底层日志底层日志调整非敏感日志level调整为debug
- 5、执行器AppName必须在调度中心配置才允许注册一个AppName可以配置多个执行器将会同时注册到对应执行器上
#### 规划中 #### 规划中

@ -45,7 +45,6 @@ public class JobLogController {
public String index(Model model, String jobGroup, String jobName) { public String index(Model model, String jobGroup, String jobName) {
// 任务组 // 任务组
List<XxlJobGroup> jobGroupList = xxlJobGroupDao.findAll(); List<XxlJobGroup> jobGroupList = xxlJobGroupDao.findAll();
model.addAttribute("jobGroup", jobGroup); model.addAttribute("jobGroup", jobGroup);
@ -92,24 +91,6 @@ public class JobLogController {
return maps; return maps;
} }
/*@RequestMapping("/save")
@ResponseBody
@PermessionLimit(limit=false)
public RemoteCallBack triggerLog(int trigger_log_id, String status, String msg) {
RemoteCallBack callBack = new RemoteCallBack();
callBack.setStatus(RemoteCallBack.FAIL);
XxlJobLog log = xxlJobLogDao.load(trigger_log_id);
if (log!=null) {
log.setHandleTime(new Date());
log.setHandleStatus(status);
log.setHandleMsg(msg);
xxlJobLogDao.updateHandleInfo(log);
callBack.setStatus(RemoteCallBack.SUCCESS);
return callBack;
}
return callBack;
}*/
@RequestMapping("/logDetail") @RequestMapping("/logDetail")
@ResponseBody @ResponseBody
public ReturnT<String> logDetail(int id){ public ReturnT<String> logDetail(int id){

@ -22,7 +22,7 @@ public class WebExceptionResolver implements HandlerExceptionResolver {
@Override @Override
public ModelAndView resolveException(HttpServletRequest request, public ModelAndView resolveException(HttpServletRequest request,
HttpServletResponse response, Object handler, Exception ex) { HttpServletResponse response, Object handler, Exception ex) {
logger.error("system catch exception:{}", ex); logger.error("WebExceptionResolver:{}", ex);
ModelAndView mv = new ModelAndView(); ModelAndView mv = new ModelAndView();
HandlerMethod method = (HandlerMethod)handler; HandlerMethod method = (HandlerMethod)handler;

@ -15,7 +15,7 @@ import org.slf4j.LoggerFactory;
public class XxlJobLogCallbackServer { public class XxlJobLogCallbackServer {
private static final Logger logger = LoggerFactory.getLogger(XxlJobLogCallbackServer.class); private static final Logger logger = LoggerFactory.getLogger(XxlJobLogCallbackServer.class);
Server server = null; private Server server = null;
public void start(int callBackPort) throws Exception { public void start(int callBackPort) throws Exception {
final int port = Integer.valueOf(callBackPort); final int port = Integer.valueOf(callBackPort);

@ -42,7 +42,7 @@ public class RemoteHttpJobBean extends QuartzJobBean {
jobLog.setJobGroup(jobInfo.getJobGroup()); jobLog.setJobGroup(jobInfo.getJobGroup());
jobLog.setJobName(jobInfo.getJobName()); jobLog.setJobName(jobInfo.getJobName());
DynamicSchedulerUtil.xxlJobLogDao.save(jobLog); DynamicSchedulerUtil.xxlJobLogDao.save(jobLog);
logger.info(">>>>>>>>>>> xxl-job trigger start, jobId:{}", jobLog.getId()); logger.debug(">>>>>>>>>>> xxl-job trigger start, jobId:{}", jobLog.getId());
// admin address // admin address
List<String> adminAddressList = JobRegistryHelper.discover(RegistHelper.RegistType.ADMIN.name(), RegistHelper.RegistType.ADMIN.name()); List<String> adminAddressList = JobRegistryHelper.discover(RegistHelper.RegistType.ADMIN.name(), RegistHelper.RegistType.ADMIN.name());
@ -89,7 +89,7 @@ public class RemoteHttpJobBean extends QuartzJobBean {
// monitor triger // monitor triger
JobMonitorHelper.monitor(jobLog.getId()); JobMonitorHelper.monitor(jobLog.getId());
logger.info(">>>>>>>>>>> xxl-job trigger end, jobId:{}", jobLog.getId()); logger.debug(">>>>>>>>>>> xxl-job trigger end, jobId:{}", jobLog.getId());
} }

@ -35,7 +35,7 @@ public class JobMonitorHelper {
public void run() { public void run() {
while (true) { while (true) {
try { try {
logger.info(">>>>>>>>>>> job monitor beat ... "); logger.debug(">>>>>>>>>>> job monitor beat ... ");
Integer jobLogId = JobMonitorHelper.helper.queue.take(); Integer jobLogId = JobMonitorHelper.helper.queue.take();
if (jobLogId != null && jobLogId > 0) { if (jobLogId != null && jobLogId > 0) {
logger.info(">>>>>>>>>>> job monitor heat success, JobLogId:{}", jobLogId); logger.info(">>>>>>>>>>> job monitor heat success, JobLogId:{}", jobLogId);

@ -21,7 +21,7 @@ public class DbRegistHelper implements RegistHelper {
String insertSql = "INSERT INTO XXL_JOB_QRTZ_TRIGGER_REGISTRY( `registry_group` , `registry_key` , `registry_value`, `update_time`) VALUES(? , ? , ?, NOW())"; String insertSql = "INSERT INTO XXL_JOB_QRTZ_TRIGGER_REGISTRY( `registry_group` , `registry_key` , `registry_value`, `update_time`) VALUES(? , ? , ?, NOW())";
int ret = DBUtil.update(dataSource, updateSql, new Object[]{registGroup, registryKey, registryValue}); int ret = DBUtil.update(dataSource, updateSql, new Object[]{registGroup, registryKey, registryValue});
if (ret<1) { if (ret<1) {
ret = DBUtil.update(dataSource, insertSql, new Object[]{registGroup, registryKey, registryValue}); //ret = DBUtil.update(dataSource, insertSql, new Object[]{registGroup, registryKey, registryValue});
} }
return ret; return ret;
} }

@ -40,7 +40,7 @@ public class JobThread extends Thread{
public void pushTriggerQueue(RequestModel requestModel) { public void pushTriggerQueue(RequestModel requestModel) {
if (triggerLogIdSet.contains(requestModel.getLogId())) { if (triggerLogIdSet.contains(requestModel.getLogId())) {
logger.info("repeate trigger job, logId:{}", requestModel.getLogId()); logger.debug("repeate trigger job, logId:{}", requestModel.getLogId());
return; return;
} }
@ -58,8 +58,6 @@ public class JobThread extends Thread{
this.stopReason = stopReason; this.stopReason = stopReason;
} }
int i = 1; int i = 1;
@Override @Override
public void run() { public void run() {
@ -83,16 +81,16 @@ public class JobThread extends Thread{
String logFileName = XxlJobFileAppender.makeLogFileName(new Date(triggerDate.getLogDateTim()), triggerDate.getLogId()); String logFileName = XxlJobFileAppender.makeLogFileName(new Date(triggerDate.getLogDateTim()), triggerDate.getLogId());
XxlJobFileAppender.contextHolder.set(logFileName); XxlJobFileAppender.contextHolder.set(logFileName);
logger.info("----------- xxl-job job handle start -----------"); logger.info("----------- xxl-job job execute start -----------");
handler.execute(handlerParams); handler.execute(handlerParams);
} catch (Exception e) { } catch (Exception e) {
logger.info("JobThread Exception:", e); logger.error("JobThread Exception:", e);
_status = ResponseModel.FAIL; _status = ResponseModel.FAIL;
StringWriter out = new StringWriter(); StringWriter out = new StringWriter();
e.printStackTrace(new PrintWriter(out)); e.printStackTrace(new PrintWriter(out));
_msg = out.toString(); _msg = out.toString();
} }
logger.info("----------- xxl-job job handle end ----------- <br> Look : ExecutorParams:{}, Status:{}, Msg:{}", logger.info("----------- xxl-job job execute end ----------- <br> Look : ExecutorParams:{}, Status:{}, Msg:{}",
new Object[]{handlerParams, _status, _msg}); new Object[]{handlerParams, _status, _msg});
// callback handler info // callback handler info
@ -109,7 +107,7 @@ public class JobThread extends Thread{
} }
} }
} catch (Exception e) { } catch (Exception e) {
logger.info("JobThread Exception:", e); logger.error("----------- xxl-job JobThread Exception:", e);
} }
} }
@ -124,6 +122,6 @@ public class JobThread extends Thread{
} }
} }
logger.info(">>>>>>>>>>>> xxl-job handlerThrad stoped, hashCode:{}", Thread.currentThread()); logger.info(">>>>>>>>>>>> xxl-job JobThread stoped, hashCode:{}", Thread.currentThread());
} }
} }

@ -31,7 +31,7 @@ public class TriggerCallbackThread {
break; break;
} }
} catch (Exception e) { } catch (Exception e) {
logger.info("JobThread Exception:", e); logger.error(">>>>>>>>>>> xxl-job TriggerCallbackThread Exception:", e);
} }
} }
} }

@ -49,7 +49,7 @@ public class IpUtil {
return localAddress; return localAddress;
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.warn("Failed to retriving ip address, " + e.getMessage(), e); logger.error("Failed to retriving ip address, " + e.getMessage(), e);
} }
try { try {
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
@ -66,17 +66,17 @@ public class IpUtil {
return address; return address;
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.warn("Failed to retriving ip address, " + e.getMessage(), e); logger.error("Failed to retriving ip address, " + e.getMessage(), e);
} }
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.warn("Failed to retriving ip address, " + e.getMessage(), e); logger.error("Failed to retriving ip address, " + e.getMessage(), e);
} }
} }
} }
} catch (Throwable e) { } catch (Throwable e) {
logger.warn("Failed to retriving ip address, " + e.getMessage(), e); logger.error("Failed to retriving ip address, " + e.getMessage(), e);
} }
logger.error("Could not get local host ip address, will use 127.0.0.1 instead."); logger.error("Could not get local host ip address, will use 127.0.0.1 instead.");
return localAddress; return localAddress;

@ -112,7 +112,7 @@ public class XxlJobNetCommUtil {
HttpEntity entity = response.getEntity(); HttpEntity entity = response.getEntity();
if (response.getStatusLine().getStatusCode() == 200 && null != entity) { if (response.getStatusLine().getStatusCode() == 200 && null != entity) {
String responseHex = EntityUtils.toString(entity, "UTF-8"); String responseHex = EntityUtils.toString(entity, "UTF-8");
logger.info("xxl-job, net comm success, requestHex:{}, responseHex:{}", requestHex, responseHex); logger.debug("xxl-job, net comm success, requestHex:{}, responseHex:{}", requestHex, responseHex);
EntityUtils.consume(entity); EntityUtils.consume(entity);
// i do not know why // i do not know why
@ -133,7 +133,7 @@ public class XxlJobNetCommUtil {
failMsg = "http statusCode error, statusCode:" + response.getStatusLine().getStatusCode(); failMsg = "http statusCode error, statusCode:" + response.getStatusLine().getStatusCode();
} }
} catch (Exception e) { } catch (Exception e) {
logger.info("", e); logger.error("", e);
/*StringWriter out = new StringWriter(); /*StringWriter out = new StringWriter();
e.printStackTrace(new PrintWriter(out)); e.printStackTrace(new PrintWriter(out));
callback.setMsg(out.toString());*/ callback.setMsg(out.toString());*/
@ -146,7 +146,7 @@ public class XxlJobNetCommUtil {
try { try {
httpClient.close(); httpClient.close();
} catch (IOException e) { } catch (IOException e) {
logger.info("", e); logger.error("", e);
} }
} }
} }

Loading…
Cancel
Save