-->
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.  [ 2 posts ] 
Author Message
 Post subject: how to turn off console log in hibernate 3.5.0 final
PostPosted: Tue Apr 13, 2010 6:06 am 
Newbie

Joined: Tue Apr 13, 2010 4:22 am
Posts: 1
Hello.
I'm newbie here. I want to turn off hibernate logging that i writing on Neatbeans 6.7.1 output. It takes ca. 5 minutes and generate more lines of informations. I configured my hibernate.cfg like this:

<property name="show_sql">false</property>
<property name="format_sql">false</property>
<property name="generate_statistics">false</property>
<property name="use_sql_comments">false</property>

Also I put ConsoleAppender in log4j.properties file

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{yyyyMMdd HH:mm:ss.SSS} [[%5p] %c{1} [%t]] %m%n
log4j.logger.org.hibernate=CONSOLE,warn

But it dosen't work. Help me please


Top
 Profile  
 
 Post subject: Re: how to turn off console log in hibernate 3.5.0 final
PostPosted: Wed Oct 13, 2010 11:31 am 
Newbie

Joined: Fri Nov 03, 2006 9:49 am
Posts: 1
Location: Harrisburg, PA
I have a similar question.

We're using the following with Spring 2.5.6. We're deploying to an Oracle 10g AS R2 (J2EE 1.3) and using a newer JDK (1.6.0_13):
Hibernate Core 3.3.1GA
Hibernate Entity Manager 3.4.0.GA
Hibernate Annotations 3.4.0.GA

If I have all the properties off in the Spring applicationContext.xml:

<!--
<entry key="hibernate.show_sql" value="true" />
<entry key="hibernate.format_sql" value="true" />
-->

And have logging configured in log4j, I don't get any of the SQL in the log4j log.

If I simply uncomment the hibernate.format_sql entry, I get logging IN THE CONSOLE LOG, AND IN THE LOG4J LOG.

I really only want the logging of the SQL (and better yet the bind variables to) to the log4j log. I don't want the server's console log to fill up with this SQL as it's then in two places. I'd like the context of the web application session (which I'm already getting with log4j) to contain the corresponding SQL.

What is the "magic" I need to get this working?

Thanks, and much apprecation for any assistance.

Eric


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