logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Russell Stocum" <bsto...@paychex.com>
Subject what happens when you include a file that has log4j logging in one that does not?
Date Fri, 15 Jun 2001 16:27:03 GMT
Class definitions are included at the end of the email:

Right now I am getting an error message from log4j that is stating:
(retyped from screen)
log4j:ERROR No appenders could be found for category (bar)
log4j:ERROR Please initialize the log4j system properly

And if I uncomment the System.out.println then it seems to not crash the
program just send these lines.
These lines are also only sent once it would seem since I had 2 classes
called Bar and Bar2 and did not see:
log4j:ERROR No appenders could be found for category (bar)
log4j:ERROR Please initialize the log4j system properly
log4j:ERROR No appenders could be found for category (bar2)
log4j:ERROR Please initialize the log4j system properly

I only got:
log4j:ERROR No appenders could be found for category (bar)
log4j:ERROR Please initialize the log4j system properly

So now is this just something that will always be printed to std out?
is there a way to turn off that message?
redirect it?
and can it be safely ignored if we have lots of new log4j coded classes
being used by older currently running
classes?

Thanks,
Ben Stocum

==================[ class MyApp ]=================
import Bar;
public class MyApp {

   public static void main(String[] args) {

     Bar bar = new Bar();
     bar.doIt();
    }
 }


==================[ class Bar ]====================

import org.apache.log4j.Category;

public class Bar {
   static Category cat = Category.getInstance(Bar.class.getName());

   public void doIt() {
     cat.debug("Did it again!");
     //System.out.println("This method has logging in it ");
   }
 }

Mime
View raw message