Why AspectJ Before and After logs not getting traced?

38 Views Asked by At

I want to get traces following logs

{
    @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);
        }
    }
}

But non of the logs getting traced. did anyone know why i`m wrong or i want to know the actual gradle dependencies which want to import

Please help me Thanks.

0

There are 0 best solutions below