Browse Source

Merge branch 'dev'

master
wxz 5 years ago
parent
commit
c272db367e
  1. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

@ -66,7 +66,12 @@ public abstract class BaseRequestLogAspect {
resultInfoLog(transactionSerial, getExecPeriod(startTime), result);
} catch (RenException e) {
result = handleRenException(e);
if (e.getCode() > 8000) {
resultWarnLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e));
} else {
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e));
}
return result;
} catch (ValidateException e) {
result = handleValidateException(e);
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getMsg(), ExceptionUtils.getErrorStackTrace(e));
@ -95,7 +100,7 @@ public abstract class BaseRequestLogAspect {
}
/**
* 异常信息
* 异常错误级别日志
* @param transactionSerial
* @param execTimeMillis
* @param result
@ -107,6 +112,19 @@ public abstract class BaseRequestLogAspect {
transactionSerial, execTimeMillis, result == null ? result : result.toString(), exceptionMsg, exceptionDetail);
}
/**
* 异常警告级别日志
* @param transactionSerial
* @param execTimeMillis
* @param result
* @param exceptionMsg
* @param exceptionDetail
*/
private void resultWarnLog(String transactionSerial, Long execTimeMillis, Object result, String exceptionMsg, String exceptionDetail) {
log.warn("<<<<<<<<异常响应<<<<<<<<:事务流水号:{}, 执行时长:{}ms, 响应数据:{}, 异常信息:{}, 堆栈信息:{}",
transactionSerial, execTimeMillis, result == null ? result : result.toString(), exceptionMsg, exceptionDetail);
}
/**
* 计算执行周期
* @param startTime

Loading…
Cancel
Save