RE: Unable to write to a log file using Log4j

Hello All,

I am unable to write to a log file using Log4j jars. I imported all log4j jars onto the project. When i execute my script, i got the following exception.

Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/Logger

kaarthiiik Default Asked on August 14, 2016 in Selenium WebDriver.
Add Comment
4 Answers

See you need to download log4j.jar…..then set the path…or enable it to your project.
Again download log4j.xml from google.

public class myclass{

void myfile(){

Logger log=logger.getlogger(“myclass”)
PropertyConfigurator.configure(“log4j.properties”);
Webdriver driver=new firefox();
driver. get(“http://google.com”);
}
}…hope this will help.

}

Default Answered on September 4, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.