-->
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: can't remove INFO [STDOUT] Hibernate: from console logging
PostPosted: Tue Mar 13, 2007 11:12 am 
Beginner
Beginner

Joined: Tue May 17, 2005 9:10 am
Posts: 29
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:Hibernate3.0.5

I'm using hibernate3 on jboss-4.0.4RC1

It's hard to believe hibernate3 logging sql via STDOUT, but i see the following logging on both jboss console and log file, ie.

//hibernate3
INFO [STDOUT] Hibernate: select messages0_.CART_ENTRY_ID as CART2_1_, .....

I've played around log4j.xml to get rid of all INFO [STDOUT] Hibernate: from console, no luck. Acctually i just want it behaves like hibernate2 - logging on debug level to show on log file only without showing on console.
//hibernate2
DEBUG [net.sf.hibernate.hql.QueryTranslator] SQL: select reservatio0_.....

Any ideas , thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 13, 2007 11:33 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
hibernate's property, hibernate.show_sql, will directly output all the sql to the console regardless of any logging configuration you have.

turn that off, and if you have log4j still on debug, the sql calls will only go to the logging file

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 13, 2007 1:24 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 9:10 am
Posts: 29
I looked into my hibernate.cfg.xml, it's set to false, ie.
<property name="show_sql">false</property>

which file you're referring to?

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 15, 2007 12:22 pm 
Beginner
Beginner

Joined: Tue May 17, 2005 9:10 am
Posts: 29
For us, it turns out that it's a Spring config file since Spring was added on the top of it. Now it works as expected:

Since Spring config is built in .ear - not configurable, i set hibernate.show_sql = false in Spring config file always, then adjust log4j.xml to log hibernate sql only to log file.

<category name="org.hibernate">
<priority value="ERROR"/>
</category>

<category name="org.hibernate.SQL">
<priority value="DEBUG"/>
</category>


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.