5 Replies Latest reply on Jan 23, 2009 7:58 AM by itsme

    disable Hibernate logs

    rogersilvasauro

      Hi people, how are you?
      I'm new to jboss, and I apologize whether this question is too easy.
      I've being searching for answer on google, and on this forum with no success.

      Please, Does somebody know how to limit Hibernate logs only for error messages?
      I've done the stops described bellow, but I'm still getting hibernate loggin its queries on jboss server.log file.

      I'm deploying my JEE app on Jboss 4.2.2GA, and this app persistence.xml include the following line:

      <property name="hibernate.show_sql" value="false"/>


      Furthermore, I've updated %JBOSS_HOME%/server/default/conf/jboss-log4j.xml including the lines bellow:

       <category name="org.jboss">
       <priority value="ERROR"/>
       </category>
       <category name="log4j.logger.net.sf.hibernate">
       <priority value="ERROR"/>
       </category>
       <category name="net.sf.hibernate">
       <priority value="ERROR"/>
       </category>
       <category name="org.core.hibernate">
       <priority value="ERROR"/>
       </category>
      


      Please, Did I miss something?

      I appreciate any help you can give me,
      Thanks,
      Roger

        • 1. Re: disable Hibernate logs
          jaikiran

           

          <category name="net.sf.hibernate">
          <priority value="ERROR"/>
          </category>
          <category name="org.core.hibernate">
          <priority value="ERROR"/>
          </category>


          The package names are incorrect. For Hibernate3, it should be:

          <category name="org.hibernate">
           <priority value="ERROR"/>
           </category>
          


          • 2. Re: disable Hibernate logs
            rogersilvasauro

             

            "jaikiran" wrote:
            <category name="net.sf.hibernate">
            <priority value="ERROR"/>
            </category>
            <category name="org.core.hibernate">
            <priority value="ERROR"/>
            </category>


            The package names are incorrect. For Hibernate3, it should be:

            <category name="org.hibernate">
             <priority value="ERROR"/>
             </category>
            


            Hi jaikiran,
            thanks a lot for helping :)
            I've updated %JBOSS_HOME%/server/default/conf/jboss-log4j.xml file with your suggestion, but I'm still getting hibernate logs like this one:

            2009-01-23 10:01:35,504 INFO [STDOUT] Hibernate: select property0_.idproperty as idproperty3_, property0_.value as value3_, property0_.key as key3_, property0_.propertyType as property4_3_, property0_.description as descript5_3_ from property property0_ where idapplication=? and property0_.key=?
            


            Please, Does somebody know how to prevent hibernate from logging this kind of stuff?

            thanks in advance,
            Roger

            • 3. Re: disable Hibernate logs
              jaikiran

              That's the SQL that's being printed. It should have been disable by your hibernate.show_sql=false setting. Can you post the entire console logs when your application starts deploying?

              • 4. Re: disable Hibernate logs
                itsme

                Maybe this is useful:
                http://www.hibernate.org/hib_docs/v3/reference/en-US/html/configuration-optional.html
                We don't set this property and do not get these logs.

                • 5. Re: disable Hibernate logs
                  itsme

                  Does anybody by any chance start the jboss as with this hibernate property set as system property set to true ?