在我的Spring + Hibernate项目中,我使用SLF4J 1.6.4和LogBack进行日志记录。现在,我通过ehcache-spring-annotations-1.1.3添加了Ehcache 2.2.0。缓存似乎正在工作,因为方法(使用@Cacheable注释)不再被执行,但返回正确的结果。但是,我想看到Ehcache写入的日志。由于Ehcache也使用SLF4J,我认为日志应该被写入我的日志文件。但是,这并没有发生。logback.xml如下所示。
Ehcache正在使用SLF4J 1.6.1,而我的项目正在使用SLF4J 1.6.4。这会导致任何问题吗?
谢谢。
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="ROLLING"/>
</root>
添加以下内容也无法帮助
<logger name="net.sf.ehcache">
</logger>
Ehcache.xml
<cache name="sampleCache1"
eternal="false"
overflowToDisk="true"
timeToIdleSeconds="300"
timeToLiveSeconds="600"
memoryStoreEvictionPolicy="LFU"
/>
请指教我如何克服这个问题。Ehcache正在使用SLF4J 1.6.1,而我的项目正在使用SLF4J 1.6.4。这会导致任何问题吗?
谢谢。