Reputation: 238
In my application I'm using Hibernate, Apache Commons Logging and Log4J. But my log files are not getting generated. Is these because Hibernate uses slf4j?
In my classpath I have the following jars.
I found that Hibernate uses slf4j. I want the logging to be delegated in the following route -
slf4j-api -> slf4j-jcl -> commons-logging -> log4j
But neither I'm getting the Hibernate logs, nor my application logs.
What could be the reason?
Upvotes: 2
Views: 1867
Reputation: 238
I'm here to mention that I've solved the issue.
I was using wife and the jar has a log4j.properties within it. It was getting loaded before my application's log4j.properties. I've reversed the order and it works now!
Thank you folks, especially for helping me out with Hibernate jars.
Upvotes: 0
Reputation: 570315
Starting with version 3.3, Hibernate indeed uses SFL4J instead of JCL (this is HHH-2696) and your dependencies delegate calls to SLF4J to JCL look correct.
However, why do you have both hibernate-3.2.7.ga.jar
(which BTW uses Commons Logging) and hibernate-core-3.3.2.GA.jar
? I wonder if this doesn't cause any conflict. Try to clean your class path and see if you don't get any error trace at startup after that.
But I would personally try to get rid of JCL instead of delegating to it. If you have some
code that uses JCL and if JCL is not a formal requirement, replace commons-logging-1.1.1.jar
with jcl-over-slf4j.jar
(a JCL-over-SLF4J bridge).
Upvotes: 1