package com.handleLog4J;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.testng.annotations.Test;
/**
* @Blog Name : https://seleniumcodeexample.blogspot.in
* @author Deepak Gupta
* @Created Date 10-08-2017
*
*/
public class Log4jExample {
public Logger logger = Logger.getLogger(Log4jExample.class);
@Test
public void testLog4j() {
PropertyConfigurator.configure("log4j.properties");
logger.debug("Sample debug message");
logger.info("Sample info message");
logger.warn("Sample warn message");
logger.error("Sample error message");
logger.fatal("Sample fatal message");
}
}
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.testng.annotations.Test;
/**
* @Blog Name : https://seleniumcodeexample.blogspot.in
* @author Deepak Gupta
* @Created Date 10-08-2017
*
*/
public Logger logger = Logger.getLogger(Log4jExample.class);
@Test
public void testLog4j() {
PropertyConfigurator.configure("log4j.properties");
logger.debug("Sample debug message");
logger.info("Sample info message");
logger.warn("Sample warn message");
logger.error("Sample error message");
logger.fatal("Sample fatal message");
}
}
No comments:
Post a Comment