jrola
jrola

Reputation: 416

Hibernate GWT: Turn off hibernate logging to console

I've searched a lot of topics in the internet with similar problems, but any can help me to solve this problem. So I'm using GWT + Hibernate (jars):

junit-4.11-beta-1.jar
mysql-connector-java-5.1.22-bin.jar
dom4j-1.6.1.jar
antlr-2.7.7.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-core-4.1.8.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
javassist-3.15.0-GA.jar
jboss-logging-3.1.0.GA.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
gwt-servlet.jar
hibernate-validator-4.0.2.GA.jar
validation-api-1.0.0.GA.jar

and all I want to do is disable console output like for example:

2012-12-14 23:41:09 org.hibernate.tool.hbm2ddl.TableMetadata <init>
INFO: HHH000126: Indexes: [primary]
2012-12-14 23:41:09 org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete

cause it makes my app very slow. How can i do that?

Upvotes: 0

Views: 2078

Answers (2)

appbootup
appbootup

Reputation: 9537

The question has no relation to GWT. The impact of performance by these logs is Zero.

If you need to turn off your hibernate logs then you need to first find how you hibernate is being initialized and then address the log level for hibernate either there or in you applications log setup. Reference .

1) In code via some Annotation
2) from a hibernate properties file
3) from hibernate.cfg.xml
4) from log4j.properties

We use hibernate.cfg.xml and turn off hibernate sql logs using
<property name="show_sql">false</property>

You need to find somethign similar for your application.

Upvotes: 2

Alexander Bortnik
Alexander Bortnik

Reputation: 1289

In your log4j configuration set hibernate logger to higher level:

<logger name="org.hibernate">
  <level value="error"/> 
</logger>

If you don't want to see info level hibernate messages.

Upvotes: 0

Related Questions