opt:日志优化
This commit is contained in:
@@ -28,6 +28,7 @@ import org.nl.common.utils.BaseCode;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.lucene.LuceneAppender;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.RequestHolder;
|
||||
import org.nl.modules.common.utils.StringUtils;
|
||||
import org.nl.modules.common.utils.ThrowableUtil;
|
||||
@@ -126,7 +127,11 @@ public class LogAspect {
|
||||
}
|
||||
}
|
||||
log.error("[-requestError-][请求接口:{}]【异常信息:{}】[请求参数:{}] {}", url, ex.getMessage(), params, ThrowableUtil.getStackTrace(ex));
|
||||
throw ex;
|
||||
if (ex instanceof BadRequestException){
|
||||
throw ex;
|
||||
}else {
|
||||
throw new BadRequestException("系统繁忙,请联系管理员确认,后再试并");
|
||||
}
|
||||
} finally {
|
||||
log.info("[--response--][请求接口:{} 执行结束][耗时:{}s]", url, (System.currentTimeMillis() - comming) / 1000);
|
||||
MDC.clear();
|
||||
|
||||
Reference in New Issue
Block a user