-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Log4j, Hibernate debug messges
PostPosted: Mon Feb 21, 2005 1:36 am 
Newbie

Joined: Mon Feb 21, 2005 1:28 am
Posts: 1
Hi,

I'm using Jboss 4.0.0 and hibernate 2.1.8 deployed as a har archive.
I used to managed hibernate session myself i.e closing and opening them.
but now i'm using HibernateContext to do that. For transactions i'm using CMT as i'm using ejbs


Before using HibernateContext, each time something goes wrong when updating the database (constraints violation ...)
or the hibernate mapping was not properly used, i get an exception with an explicit message about the error.
Now that i'm using HibernateContext, this does not happen anymore and the only message that i get each time i commit the transaction is:

[TransactionSynch] Error fushing session.

This becomes very difficult to debug.

I went through jboss and hibernate forum/docs to find a solution on how to configure the log4j.xml file to display hibernate
debug messages, i couldn't find a solution though.

I configured the threshold of the console appender to DEBUG,


Code:
   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
      <param name="Target" value="System.out"/>
      <param name="Threshold" value="DEBUG"/>
      <layout class="org.apache.log4j.PatternLayout">
         <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
      </layout>
   </appender>
   
     <root>
         <appender-ref ref="CONSOLE"/>
   </root>



I added the following categories but still, nothing gets displayed.


Code:
   <category name="net.sf.hibernate">
      <priority value="DEBUG"/>
   </category>
   
   
    <category name="org.jboss.hibernate">
            <priority value="DEBUG"/>
   </category>
   
      <category name="org.jboss.resource">
         <priority value="DEBUG"/>
   </category>
   
      <category name="org.jboss">
         <priority value="DEBUG"/>
   </category>


I even tried to use the TRACE level for my categories, no luck though

Is there a way to around this problem ? i really tried for days everything i could do.

btw is there a way to for hibernate log.properties file ???


thx in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.