Wednesday, 9 August 2017

Log4j.properties

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");
}
}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...