Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
How do I turn off the tremendous amount of logging Hiberante generates? I can't seem to control it through my log4j config file. Turning show_sql to false doesn't do it either.
Here is some of the logging:
13:18:57,877 DEBUG [QueryPlanCache] unable to locate HQL query plan in cache; generating (select count(s) from SisClient s where s.clientName like '%A%' order by s.clientName)
13:18:57,877 DEBUG [QueryTranslatorImpl] compiling query
13:18:57,892 DEBUG [HQLQueryPlan] HQL param location recognition took 0 mills (select count(s) from SisClient s where s.clientName like '%A%' order by s.clientName)
13:18:57,892 DEBUG [QueryPlanCache] located HQL query plan in cache (select count(s) from SisClient s where s.clientName like '%A%' order by s.clientName)
13:18:57,892 DEBUG [HQLQueryPlan] find: select count(s) from SisClient s where s.clientName like '%A%' order by s.clientName
13:18:57,892 DEBUG [QueryParameters] named parameters: {}
Hibernate version: 3.2
Mapping documents:
hibernate.cfg.xml:
<?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.datasource">hibernate/OracleDS</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="show_sql">false</property>
<property name="hibernate.cache.use_second_level_cache">true</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<mapping resource="com/enetrix/sis/persist/beans/sisClient.hbm.xml"/>
</session-factory>
</hibernate-configuration>
My log4j config (called A3-log4j.xml):
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="c:\log\A3.log"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} - [%C.%M] - %p - %m%n"/>
</layout>
</appender>
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.err"/>
<param name="Threshold" value="INFO"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>
</appender>
<category name="business">
<priority value="INFO"/>
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/>
</category>
<root>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
</log4j:configuration>