0
votes

We have below configuration, 1. Multi module web app based on JSF/Primefaces and Spring 4.2 (separate maven modules for WAR, service JAR etc.) 2. Using Log4j2 as application logging framework 3. Using Ehcache 3 with Spring Cache Abstraction annotations 4. Configured Pom.xml of service module JAR file for Ehcache 3 and java cache-api dependencies 5. Created Ehcache.xml in service module JAR 6. Configured Pom.xml of service WAR with Log4j core and slf4j-log4j12 binding dependencies 7. Configured log4j.xml with for “org.ehcache”

Versions, JDK 1.8 Spring 4.2 Ehcache 3.3.1 Log4j 1.2 Slf4j-log4j 1.7.7

Problem we are facing, With all this configuration in place, when we do “run on server” to WAR file on JBoss EAP 7 configured in Eclipse Neon we can’t see Ehcache related log statements in our log file. We can see our application logs though. We tried with various logging levels starting from ALL,TRACE, DEBUG but no logs in log file. Any pointers will really be helpful, we are trying to get this resolved since last 2 days but no luck.

1
The logback.xml has the following. Change it to ALL if INFO level: <root level="ALL"> ... ... </root> Secondly <logger name="net.sf.ehcache"> needs an increased logging level <logger name="net.sf.ehcache" level="ALL"/> You should then see plenty of logging statements from EhCache (and others).Anup Dey
We are using Log4j as our application logging framework, we want to capture Ehcache logs through it. We tried ALL setting to our root logger of Log4j for “ org.ehcache.cache” package as we are using ehcache 3.3.1.Kaustubh Gajare
Are you providing Ehcache in your WAR or is it installed as a module?James R. Perkins
Providing in WARKaustubh Gajare

1 Answers

0
votes

I believe you have a mismatch in your slf4j bindings. You indicate that you are using Log4j version 2 but have placed slf4j-log4j12on the classpath. However that's the binding for log4j version 1.2.

I believe you need instead the binding for log4j 2.