• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring / Hibernate Logging

 
Edgar Castanedo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

HELP!!!

Thanks in Advance!!!
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 log4j.properties will be on your classpath somewhere. If its JDK logging its JAVA_HOME/jre/lib/logging.properties.
 
Edgar Castanedo
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic