写了一个aspect用于拦截日志并记录到数据库,注入了一个LogSvc用于写日志到数据库,只要在logsvc
的writeLog()方法加了@Transaction注解,启动就会报错“the bean 'logSvc' could not be injected as a 'com.erong.acct.batch.service.generalsvc.LogSvc' because it is a JDK dynamic proxy that implements:
Action:
Consider injecting the bean as one of its interfaces or forcing the use of CGLib-based proxies by setting proxyTargetClass=true on @EnableAsync and/or @EnableC
aching.”
在bootstrap.yml开启“ proxy-target-class: true”也没用,求大神指导!!!
1、aop拦截日志为什么要存储起来这个量太大了,你直接log.info() 打在日志里不香么?
2、入库还要加事务,你不是要把自己搞死么?如果方法内有一个长时间处理 数据库直接被卡着了,mysql分分钟事务未提交。谁让你这么设计的?
冲业务逻辑上就说不通。你为什么要做这个东西?
我公司现在1天4亿的请求 1天的日志量就在200G 你的数据库是有多大啊 能这么存储数据