From: Guy R. <guy...@bb...> - 2001-05-25 19:47:25
|
Two things: First, you don't need a configurator in your code. JBoss has a Log4jService in jboss.conf that you should enable and configure there and in log4j.properties. Second, don't use System.out calls if you are using log4j. Define a category and use the logging calls. Here is all you need in your code: import org.apache.log4j.Category; public class OurBean implements SessionBean { private final Category log = Category.getInstance(getClass().getName()); public void ourMethod() { log.info("ourMethod called"); } } ----- Original Message ----- From: "Zhou Cai" <zc...@ob...> To: <jbo...@li...> Sent: Friday, May 25, 2001 1:20 PM Subject: RE: [JBoss-user] A message appears millions times in my JBoss startup window until I kill the window > Hi, > I checked my code thoroughly. I found that I used " > org.apache.log4j.BasicConfigurator.configure(); " before I call " > System.out.println("This is a test");" . If I delete " > org.apache.log4j.BasicConfigurator.configure(); ", everything is fine. > Is there some impact between Log4j and JBoss? > Thanks a lot. > > Zhou > > > > -----Original Message----- > From: jbo...@li... > [mailto:jbo...@li...]On Behalf Of Toby Allsopp > Sent: Thursday, May 24, 2001 5:26 PM > To: jbo...@li... > Subject: Re: [JBoss-user] A message appears millions times in my JBoss > startup window until I kill the window > > > On Thu, May 24, 2001 at 04:51:30PM -0500, Zhou Cai wrote: > > Hello, > > I met a problem: I created a stateful session bean. In the construction > > method of this bean, I write something like > > System.out.println("This is a test"); > > Then I generate a JAR file and copy the JAR file into the directory > > $JBoss\deploy. > > Then I start JBoss, In the startup window, the message "This is a test" > > appears millions times until I kill this window. Could somebody give me a > > hint how to avoid it? > > My enviroment is Windows 2000. > > That's interesting. Can you post a very simple example that demonstrates > this? At least post the actual code for the bean you're talking about, > and also your ejb-jar.xml and jboss.xml. If you've changed > standardjboss.xml > then post that as well. > > Toby. > > _______________________________________________ > JBoss-user mailing list > JBo...@li... > http://lists.sourceforge.net/lists/listinfo/jboss-user > > > _______________________________________________ > JBoss-user mailing list > JBo...@li... > http://lists.sourceforge.net/lists/listinfo/jboss-user > |