🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> <!--bean--> <bean id="accountService" class="com.test.service.impl.AccountServiceImpl"></bean> <!--配置Logger类--> <bean id="logger" class="com.test.utils.Logger"/> <!--配置切面--> <aop:config> <aop:aspect id="logAdvice" ref="logger"> <aop:before method="beforePrintLog" pointcut="execution(* com.test.service.impl.*.*(..))"></aop:before> <aop:after-returning method="afterReturingPrintLog" pointcut="execution(* com.test.service.impl.*.*(..))"></aop:after-returning> <aop:after-throwing method="exceptionPrintLog" pointcut="execution(* com.test.service.impl.*.*(..))"></aop:after-throwing> <aop:after method="afterPrintLog" pointcut="execution(* com.test.service.impl.*.*(..))"></aop:after> </aop:aspect> </aop:config> </beans> ~~~