日志记录功能的代码完全copy自nutz-book-project,集成到现有的项目。但是没有任何效果,运行时也不报错。如何排查是哪的问题?
13 回复
@wendal 改了,编译也没报错。运行也没报错。好像什么都没干一样。。。。
2016-07-23 11:17:00 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.annotation.AnnotationIocLoader -Found : class com.base.service.log.SysLogAopConfigration
2016-07-23 11:17:00 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.annotation.AnnotationIocLoader -Found : class com.base.service.log.SysLogService
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.NutIoc - >> Make...'$aop_syslog'<interface org.nutz.ioc.aop.config.AopConfigration>
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.ScopeContext -Save object '$aop_syslog' to [app]
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.aop.SimpleAopMaker -Load AopConfigure for anno=com.base.annotation.SLog by type=com.base.service.log.SysLogAopConfigration
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.NutIoc -Get 'sysLogService'<class com.base.service.log.SysLogService>
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.NutIoc - >> Load definition name=sysLogService
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.loader.combo.ComboIocLoader -Found IocObject(sysLogService) in AnnotationIocLoader(packages=[com.t])
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.NutIoc - >> Make...'sysLogService'<class com.base.service.log.SysLogService>
2016-07-23 11:17:01 [localhost-startStop-1] INFO org.nutz.ioc.aop.impl.DefaultMirrorFactory -skip aop check , type=com.base.service.log.SysLogService
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.ioc.impl.ScopeContext -Save object 'sysLogService' to [app]
2016-07-23 11:17:01 [localhost-startStop-1] DEBUG org.nutz.service.EntityService -Get TypeParams for self : com.modules.sys.domain.SysLog
debug了一下SysLogAopInterceptor
public void filter(InterceptorChain chain) throws Throwable {
if (before)
doLog("aop.before", chain, null);
try {
chain.doChain();
if (after)
doLog("aop.after", chain, null);
} catch (Throwable e) {
if (error)
doLog("aop.after", chain, e);
throw e;
}
}
before是false没进,after也没进
@qq_a930202f 那就简单了,查查为啥before和after为啥是false就可以了嘛
来自炫酷的 NutzCN
public @interface SLog {
String tag();
String msg();
boolean before() default false;
boolean after() default true;
boolean error() default true;
boolean async() default true;
}
before是false,after没执行
添加回复
请先登陆