为什么没有跟踪AspectJ之前和之后的日志?

时间:2019-05-30 17:53:52

标签: java spring aspectj compile-time-weaving

我想跟踪日志

{
    @Aspect    
    @Component    
    public class AspectJPay {

        private static final Logger log = LoggerFactory.getLogger(AxiPayCustomerController.class);

        @Before("execution(* lk.ideahub.symphony.controller.axipay.customer.AxiPayCustomerController.*(..))")
        public void logBefore(JoinPoint joinPoint) {
            Date date = new Date();
            String strDateFormat = "hh:mm:ss a";
            DateFormat dateFormat = new SimpleDateFormat(strDateFormat);
            String formattedDate = dateFormat.format(date);
            log.info("Current Start time Time is : {} {}", formattedDate, joinPoint.getSignature().getName());
            System.out.println("Current time of the day using Date - 12 hour format: " + formattedDate);
        }

        @After("execution(* lk.ideahub.symphony.controller.axipay.customer.AxiPayCustomerController.*(..))")
        public void logAfter(JoinPoint joinPoint) {
            Date date = new Date();
            String strDateFormat = "hh:mm:ss a";
            DateFormat dateFormat = new SimpleDateFormat(strDateFormat);
            String formattedDate = dateFormat.format(date);
            log.info("Current End Time is : {} {}", formattedDate, joinPoint.getSignature().getName());
            System.out.println("Current time of the day using Date - 12 hour format: " + formattedDate);
        }
    }
}

但是没有日志被跟踪。有谁知道我为什么错了或者我想知道想要导入的实际gradle依赖项

请帮助我 谢谢。

0 个答案:

没有答案