Java ehcache和日志记录问题
几天前,我开始在web应用程序中使用ehcache。一切都很好,我还记得当ehcache在cach中放入一些东西,或者从缓存中检索现有值时,它被写入了日志文件中。 我不知道从那时起发生了什么变化,现在ehcache仍在工作(我也在调试模式下仔细检查了它),但没有任何日志记录 这种行为的原因是什么 my maven项目中的ehcache和日志依赖项列表:Java ehcache和日志记录问题,java,logging,ehcache,Java,Logging,Ehcache,几天前,我开始在web应用程序中使用ehcache。一切都很好,我还记得当ehcache在cach中放入一些东西,或者从缓存中检索现有值时,它被写入了日志文件中。 我不知道从那时起发生了什么变化,现在ehcache仍在工作(我也在调试模式下仔细检查了它),但没有任何日志记录 这种行为的原因是什么 my maven项目中的ehcache和日志依赖项列表: <dependency> <groupId>org.slf4j</groupId> <
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.ehcache-spring-annotations</groupId>
<artifactId>ehcache-spring-annotations</artifactId>
<version>1.2.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>provided</scope>
</dependency>
org.slf4j
slf4j api
1.6.1
org.slf4j
slf4j简单
1.6.1
com.googlecode.ehcache-spring-annotations
ehcache-spring注释
1.2.0
编译
log4j
log4j
假如
我可以保证log4j.properties从那时起没有更改。要记录put/get/removes等内容,缓存需要启用统计信息。您可以通过编程或在ehcache.xml中对此进行控制。日志记录选项已启用。统计选项AFAIK仅用于ehcache监视器。但是,不管怎样,它也被启用了。只有当统计数据被启用时,缓存中关于未命中和命中的日志记录才会真正被记录。net.sf.ehcache.Cache的级别也应为debug。是的,net.sf.ehcache=debug在log4j.properties中,但是在这个答案中添加一点细节并没有帮助,在