mdf:修改es配置
This commit is contained in:
@@ -116,13 +116,27 @@ public class LogAspect {
|
||||
}
|
||||
}
|
||||
}catch (Exception ex){
|
||||
log.error("[--requestError--][请求接口:{}][请求参数:{}]【异常信息 :{}】", url,params, ex);
|
||||
StringBuffer errorInfo = new StringBuffer();
|
||||
errorInfo.append(ex.getMessage()).append("\n");
|
||||
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");
|
||||
if (x>10){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
log.error("[--requestError--][请求接口:{}][请求参数:{}]【异常信息 :{}】", url,params, errorInfo.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);
|
||||
throw ex;
|
||||
}finally {
|
||||
log.info("[--response--][请求接口:{}][请求参数:{}],请求执行结束",url,params);
|
||||
log.info("[--response--][接口:{} 执行结束][耗时:{}s]",url,(System.currentTimeMillis() - comming)/1000);
|
||||
MDC.clear();
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user