mirror of
https://gitee.com/wangkang/udf.git
synced 2026-10-20 14:13:51 +00:00
规范日志的处理
This commit is contained in:
@@ -55,7 +55,7 @@ public class MessageLog {
|
||||
try {
|
||||
msgJsonString = objectMapper.writeValueAsString(message);
|
||||
} catch (JsonProcessingException e) {
|
||||
log.error("MessageLog.msgJsonString convert msg to string error : ", e);
|
||||
log.warn("MessageLog.msgJsonString convert msg to string error : ", e);
|
||||
}
|
||||
//构造实体
|
||||
SendLog log = new SendLog();
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class RmsResponseErrorHandler extends DefaultResponseErrorHandler {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
log.error("getData", e);
|
||||
log.warn("msg:", e);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
+2
-2
@@ -131,14 +131,14 @@ public class DownLoadProcessAspect {
|
||||
try {
|
||||
Files.delete(file.toPath());
|
||||
} catch (IOException e) {
|
||||
log.error("error:", e);
|
||||
log.warn("msg:", e);
|
||||
}
|
||||
}
|
||||
if (zipFile != null) {
|
||||
try {
|
||||
Files.delete(zipFile.toPath());
|
||||
} catch (IOException e) {
|
||||
log.error("error:", e);
|
||||
log.warn("msg:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public class IdWorkerFactory {
|
||||
return result.getBody().getResult();
|
||||
} catch (Exception e) {
|
||||
//远程请求失败,快速剔除远程节点,本地重试
|
||||
log.error("rmsNexId failure , start fast switching , error ---------> {}", e.getMessage());
|
||||
log.warn("rmsNexId failure , start fast switching , error ---------> {}", e.getMessage());
|
||||
redisTemplate.delete(idWorkerWrapper.getCacheKey());
|
||||
this.localCache.remove(idWorkerWrapper.getCacheKey());
|
||||
return this.nextId(idWorkerWrapper.getDatacenterId(), idWorkerWrapper.getWorkerId());
|
||||
@@ -306,7 +306,7 @@ public class IdWorkerFactory {
|
||||
return result.getBody().getResult();
|
||||
} catch (Exception e) {
|
||||
//远程请求失败,快速剔除远程节点,本地重试
|
||||
log.error("rmsBatchNexId failure , start fast switching , error ---------> {}", e.getMessage());
|
||||
log.warn("rmsBatchNexId failure , start fast switching , error ---------> {}", e.getMessage());
|
||||
redisTemplate.delete(idWorkerWrapper.getCacheKey());
|
||||
this.localCache.remove(idWorkerWrapper.getCacheKey());
|
||||
return this.batchNextId(idWorkerWrapper.getDatacenterId(), idWorkerWrapper.getWorkerId(), count);
|
||||
|
||||
+2
-2
@@ -9,6 +9,7 @@ package org.itkk.udf.scheduler.client;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.exception.ExceptionUtils;
|
||||
import org.itkk.udf.core.RestResponse;
|
||||
import org.itkk.udf.core.exception.SystemRuntimeException;
|
||||
import org.itkk.udf.rms.Rms;
|
||||
import org.itkk.udf.scheduler.client.domain.RmsJobParam;
|
||||
import org.itkk.udf.scheduler.client.domain.RmsJobResult;
|
||||
@@ -66,7 +67,6 @@ public class SchClientHandle implements ApplicationContextAware {
|
||||
//回调
|
||||
this.callback(result);
|
||||
//抛出异常
|
||||
log.error("asyncHandle error:", e);
|
||||
throw new SchException(e);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class SchClientHandle implements ApplicationContextAware {
|
||||
*/
|
||||
@Recover
|
||||
public void recover(Exception e) {
|
||||
log.error("try to callback failed:", e);
|
||||
throw new SystemRuntimeException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -142,7 +142,6 @@ public abstract class AbstractBaseRmsJob extends AbstractBaseJob {
|
||||
//记录
|
||||
save(rmsJobParam, result);
|
||||
//抛出异常
|
||||
log.error("RmsJob error:", e);
|
||||
throw new JobExecutionException(e);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -47,7 +47,7 @@ public class JobDetailListener implements JobListener {
|
||||
try {
|
||||
this.listenerService.saveJobToBeExecuted(context);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("jobToBeExecuted:", e);
|
||||
log.warn("jobToBeExecuted:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class JobDetailListener implements JobListener {
|
||||
try {
|
||||
this.listenerService.saveJobExecutionVetoed(context);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("jobExecutionVetoed:", e);
|
||||
log.warn("jobExecutionVetoed:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class JobDetailListener implements JobListener {
|
||||
try {
|
||||
this.listenerService.saveJobWasExecuted(context, jobException);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("jobWasExecuted:", e);
|
||||
log.warn("jobWasExecuted:", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -48,7 +48,7 @@ public class TriggerDetailListener implements TriggerListener {
|
||||
try {
|
||||
this.listenerService.saveTriggerFired(context);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("triggerFired error:", e);
|
||||
log.warn("triggerFired error:", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class TriggerDetailListener implements TriggerListener {
|
||||
try {
|
||||
vetoed = this.listenerService.saveVetoJobExecution(context);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("vetoJobExecution error:", e);
|
||||
log.warn("vetoJobExecution error:", e);
|
||||
}
|
||||
return vetoed;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class TriggerDetailListener implements TriggerListener {
|
||||
try {
|
||||
this.listenerService.saveTriggerComplete(context, triggerInstructionCode);
|
||||
} catch (SchedulerException e) {
|
||||
log.error("triggerComplete error:", e);
|
||||
log.warn("triggerComplete error:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user