I actually did work the problem out.  I'm sorry I forgot to post back with what I 
found....

In my case I did not use log4j.  Instead I'm using java.util.logging which I then add 
a custom JDBC Handler to because I am logging to a DB table rather than a file or the 
JBoss server log file.  Extra handlers where added to my logger because a bean kept 
adding handlers due to an error in my design and another class that was used kept 
adding handlers each time it was instantiated.  

To fix the problem, I just added the handler the first time the bean object was 
created.  If the bean happened to get created again in anther session, I had placed a 
check around the addHandler call to make sure the Logger object had no handlers so 
that the handler would not be added again resulting in multiple calls of the same log 
statement.

In pseudo code (since I'm not at work):

Logger logger = Logger.getLogger("new");
If (Logger.getHandlers().count == 0)
    logger.addHandler(JDBCHandler);

In other words, my guess is that if you are having this problem, somewhere in your 
code logic you are adding extra handlers to your Logger object.  Therefore each time 
your log statement is multiplied and extra handler of the same type as before has been 
added to your Logger.


Josh


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3844044#3844044

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3844044


-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to