add:生产es配置

This commit is contained in:
zhangzhiqiang
2023-02-10 14:38:10 +08:00
parent 9288fde512
commit 2e9cce2284
6 changed files with 132 additions and 27 deletions

View File

@@ -116,21 +116,20 @@ public class LogAspect {
}
}
}catch (Exception ex){
StringBuffer errorInfo = new StringBuffer();
errorInfo.append(ex.getMessage()).append("\n");
StringBuffer errorStack = new StringBuffer();
String errorMsg = ex.getMessage();
int x = 0;
StackTraceElement[] stackTrace = ex.getStackTrace();
if (stackTrace!=null && stackTrace.length>0){
errorInfo.append("---堆栈信息:");
for (StackTraceElement stack : stackTrace) {
x++;
errorInfo.append(stack.toString()).append("\n");
errorStack.append(stack.toString()).append(" | ");
if (x>10){
break;
}
}
}
log.error("[--requestError--][请求接口:{}][请求参数:{}]异常信息 :{}", url,params, errorInfo.toString());
log.error("[-requestError-][请求接口:{}]【异常信息:{}】[请求参数:{}][异常堆栈:{}]", url,errorMsg,params, errorStack.toString());
Log log = new Log("ERROR", System.currentTimeMillis() - comming);
log.setExceptionDetail(ThrowableUtil.getStackTrace(ex).getBytes());
logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint) joinPoint, log);