You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Eric Chow <ec...@macaucabletv.com> on 2004/07/30 06:03:36 UTC

Failed to log message with log.error() !!!

Hello,

I use Log4J as the loggin engine.
I set a log4j.properties, but it seems not really work !!!
Please see the following configurations and source:

#=========log4j.properties==========================
log4j.rootCategory=A1

# Define the log to be a file
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=/WEB-INF/log/ejcourse.log
log4j.appender.A1.MaxBackupIndex=5
log4j.appender.A1.MaxFileSize=5000KB


# Appender A1 uses the PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d{DATE} %-5p %c - %m%n


# A1 Categories
log4j.category.com.echows=INFO,ERROR,DEBUG



// Java source
package com.echows.util;

public class UserManager  {
   private static Logger log = Logger.getLogger(UserManager.class);

   public UserManager() {
      super();
   }


   public User getUser(String username) {

      if (username == null) {
         log.error("User is null");
         log.info("Hello Info");
      }
   }
}



In the above source and properties,  and prohram. It only can use log.info()
!!!!
Why ???
How to define that in the package of com.echows, allow output DEBUG,INFO and
ERROR logging messages ???


Eric


==========================
If you know what you are doing,
it is not called RESEARCH!
==========================


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org