package automationTester;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import java.util.logging.Logger;

public class LoggingDemo1 {

    public static void main(String[] args) {
        // TODO Auto-generated method stub

        WebDriver driver = new ChromeDriver();
        **logger log =Logger.getLogger("devpinoyLogger");**
  • Edit your question with exact issue, error you received after running your code to avoid flagging your question by someone.. posting only code doesn't mean to understand everything what you want. – Bharat Mane Jul 13 '18 at 8:29
  • Have you checked your Java build path and include the following jar file into the libraries slf4j-api-1.7.7.jar and slf4j-simple-1.7.7.jar and the code should have import org.apache.log4j.Logger instead of import java.util.logging.Logger .Hope this change will solve the issue. – Ranjani Jul 13 '18 at 8:33

This line

logger log =Logger.getLogger("devpinoyLogger");

Should be

Logger log =Logger.getLogger("devpinoyLogger");

Classes are started from the uppercase in Java. However you can name your class from the lowercase (if you are not aware of Java coding conventions), but logger and Logger would be two different classes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.