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.