/**
 * 
 */
package topicsSelenium;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

/**
 * @author revan
 *
 */
public class ExampleTestNGLog4j 
{
	//Example for Selenium using TestNG, Log4j
	WebDriver driver;
	Logger logger;
	@BeforeTest
	public void startup()
	{
		
		driver = new FirefoxDriver();
	}
	@Test
	public void login()
	{
		//Initializing logger
		PropertyConfigurator.configure("C:\\Users\\revan\\git\\SeleniumPractise\\SeleniumPractise\\log4j.properties");
		logger = Logger.getLogger("ExampleTestNGLog4j");
		logger.info("Logger Started");
		driver = new FirefoxDriver();
		logger.info("Firefox Opened");
//		driver.get("http://www.google.com");
//		logger.info("google opened");
		driver.navigate().to("http://www.gmail.com");
		logger.info("gmail opened");
		
	}
	@AfterTest
	public void teardown()
	{
		driver.quit();
		logger.info("Logger Closed");
		
	}

}

@@ -524,16 +524,33 @@
 %0D%0A%09%7B%0D%0A%09%09
+//Opening Firefox
 %0D%0A%09%09driv
@@ -843,41 +843,8 @@
 );%0D%0A
-%09%09driver = new FirefoxDriver();%0D%0A
 %09%09lo
@@ -950,16 +950,35 @@
 ned%22);%0D%0A
+%09%09//Opening Gmail%0D%0A
 %09%09driver

Update ExampleTestNGLog4j.java