Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ehcache and logging issue

Some days ago I started using ehcache in web app. All was fine, and I do remember that when ehcache was putting something in the cach, or retrieving existing value from cache - it was written in the log files. I do not know what was changed since that time, and now ehcache is still working (I checked it attentively, in debug mode too), but without any logging.

What can be the cause of such behaviour?

The list of ehcache & log dependencies in my maven project:

<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>

I can assure that log4j.properties was not changed since that time.

like image 311
javagirl Avatar asked Dec 21 '25 07:12

javagirl


1 Answers

To get put/gets/removes and so on logged, the cache needs to have statistics enabled. You can control this either programmatically or in your ehcache.xml.

like image 179
Alex Snaps Avatar answered Dec 22 '25 20:12

Alex Snaps



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!