|
@@ -20,7 +20,8 @@ import java.util.concurrent.TimeUnit;
|
|
|
@Slf4j
|
|
|
public class ControllerAspect {
|
|
|
|
|
|
- @Around("execution(* com.tzld.longarticle.recommend.server.web..*Controller.*(..))")
|
|
|
+ @Around("execution(* com.tzld.longarticle.recommend.server.web..*Controller.*(..)) " +
|
|
|
+ "&& !execution(* com.tzld.longarticle.recommend.server.web.HealthCheckController.ok(..))")
|
|
|
public Object around(ProceedingJoinPoint pjp) throws Throwable {
|
|
|
TraceUtils.setMDC();
|
|
|
|
|
@@ -31,9 +32,13 @@ public class ControllerAspect {
|
|
|
JSONUtils.toJson(pjp.getArgs()));
|
|
|
Object result = pjp.proceed();
|
|
|
if (result != null && result instanceof String) {
|
|
|
- log.info("response result=[{}] cost=[{}]", result, stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
|
|
|
+ log.info("response className=[{}], method=[{}], param=[{}] result=[{}] cost=[{}]", className,
|
|
|
+ signature.getName(), JSONUtils.toJson(pjp.getArgs()), result,
|
|
|
+ stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
|
|
|
} else {
|
|
|
- log.info("response result=[{}] cost=[{}]", JSONUtils.toJson(result), stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
|
|
|
+ log.info("response className=[{}], method=[{}], param=[{}] result=[{}] cost=[{}]", className,
|
|
|
+ signature.getName(), JSONUtils.toJson(pjp.getArgs()), JSONUtils.toJson(result),
|
|
|
+ stopwatch.stop().elapsed(TimeUnit.MILLISECONDS));
|
|
|
}
|
|
|
|
|
|
TraceUtils.removeMDC();
|