接口执行时间
领取过慢
This commit is contained in:
@@ -31,7 +31,7 @@ public class AppApiMethodAspect {
|
||||
@Around("pkg()")
|
||||
// @SuppressWarnings("unchecked")
|
||||
public Object around(ProceedingJoinPoint pjp) throws Throwable {
|
||||
String start = DateUtils.format(new Date());
|
||||
long start = System.currentTimeMillis();
|
||||
// 执行被拦截的方法
|
||||
Object result = pjp.proceed();
|
||||
//请求的参数
|
||||
@@ -40,9 +40,10 @@ public class AppApiMethodAspect {
|
||||
String resultJson = new Gson().toJson(result);
|
||||
//获取request
|
||||
HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
|
||||
String end = DateUtils.format(new Date());
|
||||
log.info("\n>>>>>> 开始时间:{} 结束时间:{} \n>>>>>> {} {}\n>>>>>> {}\n>>>>>> Request: {}\n>>>>>> Response: {}",
|
||||
start,end,request.getMethod(), request.getRequestURL(), IPUtils.getIpAddr(request),
|
||||
long end = System.currentTimeMillis();
|
||||
|
||||
log.info("\n>>>>>> {} {}\n>>>>>> IP: {} \n>>>>>> execute time:{}\n>>>>>> Request: {}\n>>>>>> Response: {}",
|
||||
request.getMethod(), request.getRequestURL(), IPUtils.getIpAddr(request),end-start,
|
||||
params,
|
||||
resultJson
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user