Hi,
I am trying to configure the logger in java to log my messages. I have downloaded and added the log4j.jar to my classpath. I am receving two error messages while I am running the program to check it.The code I am using is :
import org.apache.log4j.*;
public class LoggerClass{
public static Logger myLogger =
Logger.getLogger(LoggerClass.class.getName( ));
Appender myAppender;
SimpleLayout myLayout;
public LoggerClass(){
myLayout = new SimpleLayout();
myAppender = new ConsoleAppender(myLayout);
}
public static void main(String args[])
{
myLogger.info("This is info");
myLogger.error("Error");
myLogger.debug("Debug");
}
}
I am receiving the following error messages while trying to run the program :
log4j:WARN No appenders could be found for logger (LoggerClass).
log4j:WARN Please initialize the log4j system properly.
What could be the cause...help would be greatly appreciated?