[jboss-user] [Beginners Corner] - Re: log4j: loggin to different files + sheduler

jaikiran do-not-reply at jboss.com
Sun Feb 10 09:50:04 EST 2008


public class myclass{
  |     protected static Logger log; 
  | 
  |     public myclass(String log4jcategory) {
  |          log = Logger.getLogger(log4jCategory);
  |     }
  |   ....
  | }
  | 	

This looks wrong. You are maintaining one class level variable which can only hold one logger at a time. So if scheduler1 calls this first and then scheduler2 calls this later with a different parameter, then the 'log' member variable will hold reference to the logger for scheduler2. You will no longer have reference of the logger of scheduler1. You will have to rewrite this myclass, to fix this.


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

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



More information about the jboss-user mailing list