-->
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.  [ 4 posts ] 
Author Message
 Post subject: How to turn off logging
PostPosted: Thu Aug 12, 2004 10:08 am 
Newbie

Joined: Wed Aug 11, 2004 11:41 am
Posts: 14
How do I turn off the printing of logging information. I set
hibernate.show_sql to false in my hibernate properties file and
verify that it is in fact false when I create the Properties object.
However, the logging output still appears.

[b]Hibernate version:[/b]
2.1.6
[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]Debug level Hibernate log excerpt:[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2004 11:35 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Configure the logging toolkit you use accordingly (log4j or jdk1.4 logging)


Top
 Profile  
 
 Post subject: Re: How to turn off logging
PostPosted: Thu Aug 12, 2004 11:49 am 
Beginner
Beginner

Joined: Mon Jul 26, 2004 4:29 pm
Posts: 45
Location: TX, USA
sburoff wrote:
How do I turn off the printing of logging information. I set
hibernate.show_sql to false in my hibernate properties file and
verify that it is in fact false when I create the Properties object.
However, the logging output still appears.


Hibernate uses a logging API, and logs much more than the produced SQL. The commons-logging and the log4j jars are included in the distribution, so I assume they are using a combination of those. This means that if you create a log4j.properties file on your classpath (before another log4j.properties is found) and put this content in it:

Code:
log4j.rootLogger = info, default

# "default" appender
log4j.appender.default=org.apache.log4j.FileAppender
log4j.appender.default.File=./logs/default.log
log4j.appender.default.Append=false
log4j.appender.default.layout=org.apache.log4j.SimpleLayout


You will get a default.log file in the logs directory with log entries of level info and above included in it.

http://jakarta.apache.org/commons/logging/ is a good place to look for more info.

HTH,
Maury


Top
 Profile  
 
 Post subject: Thanks all
PostPosted: Thu Aug 12, 2004 12:25 pm 
Newbie

Joined: Wed Aug 11, 2004 11:41 am
Posts: 14
Thanks to everyone for their replies. I have it working.
This forum is great for new users. Hibernate is sooo much
better than raw JDBC.


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