0

我想跟踪日志

{
    @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 依赖项

请帮助我谢谢。

4

0 回答 0