This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Spring / Hibernate Logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Spring / Hibernate Logging" Watch "Spring / Hibernate Logging" New topic

Spring / Hibernate Logging

Edgar Castanedo

Joined: May 15, 2003
Posts: 23
Since I think this is a Hibernate thing, I will post here. Sorry if it's in the wrong place.

So I created a web application which uses Spring and Hibernate. During every hibernate call, there is some log data being sent to standard out which I do not want.

Tue Oct 04 16:16:46 PDT 2005 TRACE:
Tue Oct 04 16:16:46 PDT 2005 TRACE:
Tue Oct 04 16:16:46 PDT 2005 TRACE:
Tue Oct 04 16:16:46 PDT 2005 TRACE:
Tue Oct 04 16:16:46 PDT 2005 TRACE:

Now imagine this like a few hundred times in your log file. Does anyone know why and how I can disable this??? I am pretty sure this is Hibernate as it wasn't happening until I integrated Hibernate.


Thanks in Advance!!!
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Hibernate uses Commons Logging to control its log messages. It logs at INFO level by default, so there must be a configuration somewhere else in your application which is asking for log levels at TRACE. Look at the class the log method is being made from (should be included in the log message) - is it a Hibernate class? It depends which logging framework you are using as to where a config. file will be, if its log4j then will be on your classpath somewhere. If its JDK logging its JAVA_HOME/jre/lib/

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Edgar Castanedo

Joined: May 15, 2003
Posts: 23
Thanks for the info. It looks like my app is using standard JDK logging. I tried to implement log4j, but was not succesful. I tried to add the log4j jar file in my WEB-INF/lib and my Spring Beans would not load any longer. Tomcat complains that it could not find the bean classes. I am assuming some library that log4j uses is breaking down which may be caused by some CLASSPATH issues introduced when I added log4j. Does this make sense? Anybody ever deal with this issue?
Consider Paul's rocket mass heater.
subject: Spring / Hibernate Logging
Similar Threads
Websphere security -- SOAP signatures -- Redbook webbank example
WAS failed to start
WTRN0031E: Error to recover XAResource:
Error 500 while accessing jsp