Monday, June 17, 2013

Selenium - log4j:WARN

Selenium : log4j:WARN




Please find the below steps to solve the issue

Issue :
log4j:WARN No appenders could be found for logger (com.app.MyLogger).
log4j:WARN Please initialize the log4j system properly.


Solution :
1)download log4j-1.2rc1-2002-04-16.jar file
2)Add the log4j-1.2rc1-2002-04-16.jar file to build path
3)create object private static org.apache.log4j.Logger log= Logger.getLogger(MyLogger.class);
4)once you run the Mylogger.java file system will automatically creates the log4j.properties file
5)find out the log4j.propertiesfile and replace the contents as per the requirements(mostly system will creates in bin directory)
6)if not find log4j.properties file create one new file in bin directory (/workspace/projectdirectory/bin/)
6)log4j.properties
log4j.rootLogger=debug, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%t %-5p %c{2} - %m%

No comments:

Post a Comment