On 02/12/2005, at 8:03 AM, Burton Strauss wrote:

That's easy ... console output is from System.out.println(). How else are
you going to test the logger if you can't trust it... :-)

Umm, in your original post you had log4j logging in the test:
    Appender t = LogManager.getRootLogger().getAppender( "test");
    if(null == t) {
      logger.info("LogManager.getRootLogger().getAppender(\"test\") is
null");
    } else if(t instanceof FileAppender) {
      logger.info("LogManager.getRootLogger().getAppender(\"test\") is
FileAppender");
    } else {
      logger.info("LogManager.getRootLogger().getAppender(\"test\") is
something else");
    }



But the other path still fails.  I expanded the test program to this:

  public static void main(String[] args) {
    Logger logger = null;
    logger = logger.getLogger("test");
    logger.info("Beginning logger test");
    int countOfLoggers = 0;
    Enumeration loggers =
LogManager.getLoggerRepository().getCurrentLoggers();
    if(loggers != null){
      while(loggers.hasMoreElements()){
</snip>

Ok, in this test you have gotten rid of your log4j.properties.... Correct? If so, then where is the configuration of actually _adding_ the FileAppender ? Or what _is_ configuring log4j in this test?

Paul

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to