-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: ehcache logging?
PostPosted: Thu Apr 08, 2004 12:11 am 
Newbie

Joined: Fri Feb 27, 2004 6:17 pm
Posts: 11
Try, try, try as I might, I can't seem to get ehcache to generate any logging information. I even implemented my own dummy version of Cache/CacheProvider that logs to log4j, and while that works (nicely illustrating Hibernate's cache behavior, by the way), switching back to ehcahce doesn't seem to work.

Hibernate does report that ehcache is loading, and as near as I can tell, ehcache even seems to be working, but no logging, no debug output, nothing...

According to the documentation, ehcache uses JDK 1.4 logging. Changes to the JAVA_HOME/jre/lib/logging.properties file don't seem to have any effect.

Apparently, I'm not the only one to have had this problem with JDK 1.4 logging...

link to mailing list with same problem

I've seen others on this forum who seem to have managed to get logging out of ehcache... is there a special trick?

I'm running inside of Eclipse M8, if that makes any difference.


Top
 Profile  
 
 Post subject: Re: ehcache logging?
PostPosted: Tue Feb 23, 2010 8:55 am 
Newbie

Joined: Tue Feb 23, 2010 8:52 am
Posts: 1
ehcache uses slf4j for loggin. You also need to include slf4j-log4j12 jar in your classpath.
If you are usign maven, you can add the following entry to your pom.xml:
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.5.8</version>
</dependency>


Top
 Profile  
 
 Post subject: Re: ehcache logging?
PostPosted: Fri Jul 09, 2010 8:18 am 
Newbie

Joined: Fri Jul 09, 2010 7:03 am
Posts: 1
Hello,

we also have a problem with ehcache logging. If we switch the hibernateProperties in applicationContext.xml from

Code:
<prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</prop>

to
Code:
<prop key="hibernate.cache.region.factory_class">net.sf.ehcache.hibernate.EhCacheRegionFactory</prop>

there are no more cache informations in our logfile :(

We use
- Hibernate 3.5.1
- Spring 2.5.6
- Log4j 1.2.14
- EhCache 2.1.0 (with slf4j-api-1.5.11.jar & slf4j-log4j12-1.5.11.jar in path)

Log4j Config:
Code:
<logger name="org.hibernate.cache">
        <level value="debug"/>
        <appender-ref ref="SQL"/>
</logger>


No changes made in ehcache.xml!

With SingletonEhCacheProvider it looks like:
Quote:
2010-07-09 14:08:44,947 DEBUG org.hibernate.cache.NonstrictReadWriteCache.get(NonstrictReadWriteCache.java:66) - Cache lookup: ch.xxxxx.Text#ch.xxxxxx.TextId@eaf230d9
2010-07-09 14:08:44,947 DEBUG net.sf.ehcache.hibernate.EhCache.get(EhCache.java:90) - key: ch.xxxxxxx.Text#ch.xxxxx.TextId@eaf230d9
2010-07-09 14:08:44,947 DEBUG org.hibernate.cache.NonstrictReadWriteCache.get(NonstrictReadWriteCache.java:71) - Cache hit


Anyone who can help? Missing Configuration somewhere?

Thanks in advance!


Top
 Profile  
 
 Post subject: Re: ehcache logging?
PostPosted: Sun Mar 27, 2011 5:24 am 
Newbie

Joined: Sun Mar 13, 2011 5:37 am
Posts: 3
Hi all,
Though I don’t have a specific solution for these issues, here are some interesting facts regarding Ehcache logging, originally taken from the White Paper “Caching Use Cases in the Enterprise” by Teracotta Server, that you should take into account as an administrator, when determining an Ehcache logging strategy in the first place. Hope this will generate some thoughts that will point you in the right direction.
Mary


Top
 Profile  
 
 Post subject: Re: ehcache logging?
PostPosted: Sun Mar 27, 2011 6:32 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
to java_dev_4 : nice that you try to be helpful, but take in consideration that you're answering to a 6 years old thread. I'm sure SLF4J wasn't used then.

to langmar: configuration rules changed, you likely disabled the cache. Check the reference for the specific version of Hibernate and EHCache you're using. BTW I don't think EHCache2 was tested with hibernate 3.5

Mary, I appreciate help on the forums, but please keep spam and marketing material out of here.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.