Using Hibernate (4.3.8) with MySQL, I noticed a bunch of SHOW WARNINGS
statements taking considerable bandwidth in the activity log:
I searched around and it's a pretty common issue (for example) that can apparently be resolved by increasing the log level to ERROR (and that solution is confirmed implemented since at least 4.3.6).
The problem is, I don't actually know how to do this. My knowledge of Hibernate is about the bare minimum necessary to work with it. The previously linked post solved it by editing Logback settings in logback.xml
but I'm not using Logback. I'm using all the default settings:
- Apparently it uses JBoss Logging at its core.
- I don't have any of the other logging dependencies in my classpath (e.g. slf4j.jar) so I'm definitely not using those. The log messages are just being written out to
System.err
.
So I'm not actually sure how to do this. Here is my configuration file:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/xxxxx</property>
<property name="connection.username">xxxxx</property>
<property name="connection.password">xxxxx</property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="connection.isolation">2</property>
<property name="connection.pool_size">10</property>
<property name="current_session_context_class">thread</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
<!-- <property name="show_sql">true</property> -->
<!-- <property name="hbm2ddl.auto">create</property> -->
<mapping resource="hibernate.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Here are the dependencies in the build path; there's Jettison and Joda, the MySQL driver, and then everything from Hibernate's required
dependency directory and nothing else:
How do I increase the log level or otherwise disable SHOW WARNINGS
in this (default settings) case? This mentions "log categories of interest" but I'm not sure how those relate to the configuration file. This page doesn't have any log related properties documented outside the "Logging" section, which mentions SLF4J, but apparently I'm not using SLF4J (how could I be, since it's not in my classpath).