-->
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.  [ 2 posts ] 
Author Message
 Post subject: Logging issue in Hibernate Tools plugin in Eclipse
PostPosted: Wed Mar 16, 2011 6:41 pm 
Newbie

Joined: Tue Mar 15, 2011 6:12 pm
Posts: 1
I am using the hibernate tools in Eclipse to reverse engineer an SQLServer DB.
To debug some issues, I enabled debug logging in hibernate-log4j.properties.
Globally, I'm really pleased with the reverse engineering, but I encountered a couple of issues related to logging, which I thought might be useful to other users.

1. After changing the hibernate-log4j.properties in the eclipse plugin directory, you have to restart eclipse for the changes to take effect. It would be useful to add this to the documentation.

2. After enabling DEBUG level, I got DEBUG level messages from my custom strategy class and some other Hibernate classes like org.hibernate.cfg.Configuration. But I didn't get any logs from any classes in the org.hibernate.cfg.reveng package, like JDBCReader, even though I saw from the source code that I should be getting some.
I finally noticed that these classses in hibernate tools use the commons-logging LogFactory while classes in org.hibernate.cfg used the slf4j LogFactory.
And in eclipse system properties, I found
Code:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog


I don't know where this is set, since it is not in my eclipse.ini; perhaps in some other plugin (Mylyn?)
At any rate, I fixed it by creating a commons-logging.properties file containing
Code:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

and putting this in the classpath of my Hibernate Console configuration.


Top
 Profile  
 
 Post subject: Re: Logging issue in Hibernate Tools plugin in Eclipse
PostPosted: Wed Apr 06, 2011 6:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Glad you succeeded - I also don't know where the apache logging property is set but its a common problem in a plugin system to have global configurations like this logging setup. no real good solution afaik.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.