Selaa lähdekoodia

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

xueli.xue 8 vuotta sitten
vanhempi
commit
859207d05e

+ 2 - 0
README.md Näytä tiedosto

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

+ 0 - 19
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobLogController.java Näytä tiedosto

@@ -45,7 +45,6 @@ public class JobLogController {
45 45
 	public String index(Model model, String jobGroup, String jobName) {
46 46
 
47 47
 		// 任务组
48
-
49 48
 		List<XxlJobGroup> jobGroupList =  xxlJobGroupDao.findAll();
50 49
 
51 50
 		model.addAttribute("jobGroup", jobGroup);
@@ -92,24 +91,6 @@ public class JobLogController {
92 91
 		return maps;
93 92
 	}
94 93
 	
95
-	/*@RequestMapping("/save")
96
-	@ResponseBody
97
-	@PermessionLimit(limit=false)
98
-	public RemoteCallBack triggerLog(int trigger_log_id, String status, String msg) {
99
-		RemoteCallBack callBack = new RemoteCallBack();
100
-		callBack.setStatus(RemoteCallBack.FAIL);
101
-		XxlJobLog log = xxlJobLogDao.load(trigger_log_id);
102
-		if (log!=null) {
103
-			log.setHandleTime(new Date());
104
-			log.setHandleStatus(status);
105
-			log.setHandleMsg(msg);
106
-			xxlJobLogDao.updateHandleInfo(log);
107
-			callBack.setStatus(RemoteCallBack.SUCCESS);
108
-			return callBack;
109
-		}
110
-		return callBack;
111
-	}*/
112
-	
113 94
 	@RequestMapping("/logDetail")
114 95
 	@ResponseBody
115 96
 	public ReturnT<String> logDetail(int id){

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java Näytä tiedosto

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

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/core/callback/XxlJobLogCallbackServer.java Näytä tiedosto

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

+ 2 - 2
xxl-job-admin/src/main/java/com/xxl/job/admin/core/jobbean/RemoteHttpJobBean.java Näytä tiedosto

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

+ 1 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobMonitorHelper.java Näytä tiedosto

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

+ 1 - 1
xxl-job-core/src/main/java/com/xxl/job/core/registry/impl/DbRegistHelper.java Näytä tiedosto

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

+ 6 - 8
xxl-job-core/src/main/java/com/xxl/job/core/router/thread/JobThread.java Näytä tiedosto

@@ -40,7 +40,7 @@ public class JobThread extends Thread{
40 40
 
41 41
 	public void pushTriggerQueue(RequestModel requestModel) {
42 42
 		if (triggerLogIdSet.contains(requestModel.getLogId())) {
43
-			logger.info("repeate trigger job, logId:{}", requestModel.getLogId());
43
+			logger.debug("repeate trigger job, logId:{}", requestModel.getLogId());
44 44
 			return;
45 45
 		}
46 46
 
@@ -58,8 +58,6 @@ public class JobThread extends Thread{
58 58
 		this.stopReason = stopReason;
59 59
 	}
60 60
 	
61
-
62
-	
63 61
 	int i = 1;
64 62
 	@Override
65 63
 	public void run() {
@@ -83,16 +81,16 @@ public class JobThread extends Thread{
83 81
 						String logFileName = XxlJobFileAppender.makeLogFileName(new Date(triggerDate.getLogDateTim()), triggerDate.getLogId());
84 82
 
85 83
 						XxlJobFileAppender.contextHolder.set(logFileName);
86
-						logger.info("----------- xxl-job job handle start -----------");
84
+						logger.info("----------- xxl-job job execute start -----------");
87 85
 						handler.execute(handlerParams);
88 86
 					} catch (Exception e) {
89
-						logger.info("JobThread Exception:", e);
87
+						logger.error("JobThread Exception:", e);
90 88
 						_status = ResponseModel.FAIL;
91 89
 						StringWriter out = new StringWriter();
92 90
 						e.printStackTrace(new PrintWriter(out));
93 91
 						_msg = out.toString();
94 92
 					}
95
-					logger.info("----------- xxl-job job handle end ----------- <br> Look : ExecutorParams:{}, Status:{}, Msg:{}",
93
+					logger.info("----------- xxl-job job execute end ----------- <br> Look : ExecutorParams:{}, Status:{}, Msg:{}",
96 94
 							new Object[]{handlerParams, _status, _msg});
97 95
 					
98 96
 					// callback handler info
@@ -109,7 +107,7 @@ public class JobThread extends Thread{
109 107
 					}
110 108
 				}
111 109
 			} catch (Exception e) {
112
-				logger.info("JobThread Exception:", e);
110
+				logger.error("----------- xxl-job JobThread Exception:", e);
113 111
 			}
114 112
 		}
115 113
 		
@@ -124,6 +122,6 @@ public class JobThread extends Thread{
124 122
 			}
125 123
 		}
126 124
 		
127
-		logger.info(">>>>>>>>>>>> xxl-job handlerThrad stoped, hashCode:{}", Thread.currentThread());
125
+		logger.info(">>>>>>>>>>>> xxl-job JobThread stoped, hashCode:{}", Thread.currentThread());
128 126
 	}
129 127
 }

+ 1 - 1
xxl-job-core/src/main/java/com/xxl/job/core/router/thread/TriggerCallbackThread.java Näytä tiedosto

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

+ 4 - 4
xxl-job-core/src/main/java/com/xxl/job/core/util/IpUtil.java Näytä tiedosto

@@ -49,7 +49,7 @@ public class IpUtil {
49 49
 				return localAddress;
50 50
 			}
51 51
 		} catch (Throwable e) {
52
-			logger.warn("Failed to retriving ip address, " + e.getMessage(), e);
52
+			logger.error("Failed to retriving ip address, " + e.getMessage(), e);
53 53
 		}
54 54
 		try {
55 55
 			Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
@@ -66,17 +66,17 @@ public class IpUtil {
66 66
 										return address;
67 67
 									}
68 68
 								} catch (Throwable e) {
69
-									logger.warn("Failed to retriving ip address, " + e.getMessage(), e);
69
+									logger.error("Failed to retriving ip address, " + e.getMessage(), e);
70 70
 								}
71 71
 							}
72 72
 						}
73 73
 					} catch (Throwable e) {
74
-						logger.warn("Failed to retriving ip address, " + e.getMessage(), e);
74
+						logger.error("Failed to retriving ip address, " + e.getMessage(), e);
75 75
 					}
76 76
 				}
77 77
 			}
78 78
 		} catch (Throwable e) {
79
-			logger.warn("Failed to retriving ip address, " + e.getMessage(), e);
79
+			logger.error("Failed to retriving ip address, " + e.getMessage(), e);
80 80
 		}
81 81
 		logger.error("Could not get local host ip address, will use 127.0.0.1 instead.");
82 82
 		return localAddress;

+ 3 - 3
xxl-job-core/src/main/java/com/xxl/job/core/util/XxlJobNetCommUtil.java Näytä tiedosto

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