title: How do I turn off Hibernate debug logging in JBoss Wildfly 9?
body: <p>I’m using JBoss Wildfly 9.0.0.CR2.  I have a Spring 3.2.11.RELEASe web application and I’m curious about how to turn off Hibernate logging in my $JBOSS_HOME/standalone/log/server.log file, in particular all the query data, like</p>
  
  <pre><code>[DEBUG,SQL] select organizati0_.USER_ID as USER_ID1_117_0_, organizati0_.ORGANIZATION_ID as ORGANIZA2_122_0_, organizati1_.id as id1_5_1_, organizati1_.ADDRESS_ID as ADDRESS10_5_1_, organizati1_.COUNTRY_ID as COUNTRY11_5_1_, organizati1_.CREATED_ON as CREATED_2_5_1_, organizati1_.ORGANIZATION_ID as ORGANIZA3_5_1_, organizati1_.IMPLEMENTATION_MANAGER_ID as IMPLEME12_5_1_, organizati1_.IMPORT_DATA_FROM_SIS as IMPORT_D4_5_1_, organizati1_.LTI_REFERER_DOMAIN as LTI_REFE5_5_1_, organizati1_.NAME as NAME6_5_1_, organizati1_.ORGANIZATION_TYPE_ID as ORGANIZ13_5_1_, organizati1_.PARENT_ORGANIZATI
  </code></pre>
  
  <p>In my $JBOSS_HOME/standalone/configuration/standalone.xml file I have</p>
  
  <pre><code>    &lt;subsystem xmlns="urn:jboss:domain:logging:3.0"&gt;
          &lt;console-handler name="CONSOLE"&gt;
              &lt;level name="INFO"/&gt;
              &lt;formatter&gt;
                  &lt;named-formatter name="COLOR-PATTERN"/&gt;
              &lt;/formatter&gt;
          &lt;/console-handler&gt;
          &lt;periodic-rotating-file-handler name="FILE" autoflush="true"&gt;
              &lt;formatter&gt;
                  &lt;named-formatter name="PATTERN"/&gt;
              &lt;/formatter&gt;
              &lt;file relative-to="jboss.server.log.dir" path="server.log"/&gt;
              &lt;suffix value=".yyyy-MM-dd"/&gt;
              &lt;append value="true"/&gt;
          &lt;/periodic-rotating-file-handler&gt;
          &lt;logger category="com.arjuna"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="org.apache.tomcat.util.modeler"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="org.jboss.as.config"&gt;
              &lt;level name="DEBUG"/&gt;
          &lt;/logger&gt;
          &lt;logger category="sun.rmi"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="jacorb"&gt;
              &lt;level name="WARN"/&gt;
          &lt;/logger&gt;
          &lt;logger category="jacorb.config"&gt;
              &lt;level name="ERROR"/&gt;
          &lt;/logger&gt;
          &lt;logger category="org.jasypt"&gt;
              &lt;level name="DEBUG"/&gt;
          &lt;/logger&gt;
          &lt;logger category="org.springframework"&gt;
              &lt;level name="ERROR"/&gt;
          &lt;/logger&gt;
          &lt;logger category="org.hibernate"&gt;
              &lt;level name="ERROR"/&gt;
          &lt;/logger&gt;
          &lt;root-logger&gt;
              &lt;level name="INFO"/&gt;
              &lt;handlers&gt;
                  &lt;handler name="CONSOLE"/&gt;
                  &lt;handler name="FILE"/&gt;
              &lt;/handlers&gt;
          &lt;/root-logger&gt;
          &lt;formatter name="PATTERN"&gt;
              &lt;pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/&gt;
          &lt;/formatter&gt;
          &lt;formatter name="COLOR-PATTERN"&gt;
              &lt;pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/&gt;
          &lt;/formatter&gt;
      &lt;/subsystem&gt;
  </code></pre>
  
  <p>Note my </p>
  
  <pre><code>        &lt;logger category="org.hibernate"&gt;
              &lt;level name="ERROR"/&gt;
          &lt;/logger&gt;
  </code></pre>
  
  <p>has no effect.  I have no log4j.properties or log4j.xml in my web application.  How do I turn off the Hibernate debugging?</p>
  
  <p><b>Edit:</b></p>
  
  <p>Below is how my entity manager factory is being configured in my Spring context ...</p>
  
  <pre><code>&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;property name="packagesToScan" value="org.mainco.subco" /&gt;
      &lt;property name="jpaVendorAdapter"&gt;
          &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"/&gt;
      &lt;/property&gt;
      &lt;property name="dataSource" ref="dataSource"/&gt;
      &lt;property name="jpaPropertyMap" ref="jpaPropertyMap" /&gt;
  &lt;/bean&gt;
  
  &lt;util:map id="jpaPropertyMap"&gt;
      &lt;entry key="hibernate.show_sql" value="false" /&gt;
      &lt;entry key="hibernate.hbm2ddl.auto" value="validate"/&gt;
          &lt;entry key="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/&gt;
          &lt;entry key="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" /&gt;
          &lt;entry key="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/&gt;
          &lt;entry key="hibernate.cache.provider_class" value="org.hibernate.cache.EhCacheProvider"/&gt;
          &lt;entry key="hibernate.cache.use_second_level_cache" value="true" /&gt;
          &lt;entry key="hibernate.cache.use_query_cache" value="false" /&gt;
          &lt;entry key="hibernate.generate_statistics" value="false" /&gt;
  &lt;/util:map&gt;
  
  &lt;bean id="entityManager" class="org.springframework.orm.jpa.support.SharedEntityManagerBean"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory"/&gt;
  &lt;/bean&gt;
  
  &lt;jee:jndi-lookup jndi-name="java:jboss/datasources/MySqlDS" id="dataSource" expected-type="javax.sql.DataSource"/&gt;
  
  &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
      &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
  &lt;/bean&gt; 
  </code></pre>
  
  <p>:</p>
  
  <p>in my WEB-INF/lib directory I have a commons-logging-1.1.1.jar and I also link to JBoss' pre-packaged slf4j module (below is the snippet from the WEB-INF/jboss-deployment-structure.xml file) ...</p>
  
  <pre><code>&lt;jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"&gt;
      &lt;deployment&gt;
              &lt;dependencies&gt;
                      &lt;module name="org.codehaus.jackson.jackson-core-asl" /&gt;
                      &lt;module name="org.codehaus.jackson.jackson-mapper-asl" /&gt;
                      &lt;module name="org.slf4j" /&gt;
                      ...
  </code></pre>
  
  <p><b>Edit 2</b>:</p>
  
  <p>Here are some other lines that precede and follow the debug SQL I'd like to eliminate from teh server log (I'd like to eliminate these lines too):</p>
  
  <pre><code>[DEBUG,EntityPrinter] org.mainco.subco.user.domain.User{lastName=test, creator=org.mainco.subco.user.domain.User#ADMIN1, incorrectLogins=null, address=org.mainco.subco.organization.domain.Address#77F7FAC9174A4BCA9A9C5E98F50DD134, userDemographicInfo=null, roles=[org.mainco.subco.user.domain.Role#Instructional Coach], resetState=false, avatar=null, userName=coach, createdOn=2015-07-24 15:39:59.0, enabled=true, url=localhost, firstName=test, temporaryPassword=null, password=V0VW0k+ge+free1My+bS/XSm7qb0ezuvL+irH+A9l5dnMoW0YnZNda2n2Zl138N2BN51MQ==, dob=null, grade=null, organizations=[org.mainco.subco.organization.domain.Organization#6942B22F268A4E66B50C71278E3DAA73], expiration=null, middleName=a, id=5F61E8CA3A554FE1991A05A3E960D442, salutation=null}
  [DEBUG,EntityPrinter] org.mainco.subco.organization.domain.Organization{country=org.mainco.subco.organization.domain.Country#US, address=org.mainco.subco.organization.domain.Address#12946ACF562840458844D8083191CB73, eodbId=104112, parentOrganization=null, sampleOrg=null, createdOn=null, implementationManager=null, url=null, organizationType=org.mainco.subco.organization.domain.OrganizationType#19, userEntered=false, ltiRefererDomain=null, useExternalAuthentication=false, name=Alpine School District, id=6942B22F268A4E66B50C71278E3DAA73, state=org.mainco.subco.organization.domain.State#UT, importDataFromSis=false}
  [DEBUG,EntityPrinter] org.mainco.subco.organization.domain.OrganizationType{parent=true, description=Regular District, id=19}
  [DEBUG,SQL] select user0_.id as id1_117_, user0_.ADDRESS_ID as ADDRESS17_117_, user0_.AVATAR as AVATAR2_117_, user0_.CREATED_ON as CREATED_3_117_, user0_.CREATOR_ID as CREATOR18_117_, user0_.DOB as DOB4_117_, user0_.ENABLED as ENABLED5_117_, user0_.EXPIRATION as EXPIRATI6_117_, user0_.first_name as first_na7_117_, user0_.GRADE_ID as GRADE_I19_117_, user0_.INCORRECT_LOGINS as INCORREC8_117_, user0_.last_name as last_nam9_117_, user0_.middle_name as middle_10_117_, user0_.password as passwor11_117_, user0_.RESET_STATE as RESET_S12_117_, user0_.salutation as salutat13_117_, user0_.temporary_password as tempora14_117_, user0_.url as url15_117_, user0_.USER_DEMOGRAPHIC_INFO_ID as USER_DE20_117_, user0_.user_name as user_na16_117_ from sb_user user0_ where user0_.user_name=? and user0_.url=?
  [DEBUG,CriteriaQueryImpl] Rendered criteria query -&gt; select generatedAlias0 from Role as generatedAlias0 where generatedAlias0.name=:param0
  </code></pre>