I want AOP logging for the method's return value
@After("execution(* com.dbs.tup.sample.service.*.*(..))")
public void logAfter(JoinPoint point) {
log.info("{} is returning {}", point.getSignature().getName(), "???");
}
I found this
@AfterReturning(pointcut = "execution(* com.dbs.tup.sample.service.*.*(..))", returning = "retValue")
public void logAfter(JoinPoint point, Object retValue) {
log.info("{} is returning {}", point.getSignature().getName(), (((MethodSignature) point.getSignature()).getReturnType().cast(retValue)).toString());
}