Writing Test Case with Log4j logging

Steps to follow:

1) Create a new XML file – log4j.xml and place it under the Project root folder and Paste the following code in the log4j.xml file

Note: After pasting the code make sure that the code is exactly same, as copying from HTML may change some symbols(“) to (?). 2) Now include logging code in to your test script

3) Check the output file “logfile.txt”. The output will look like below:

Log4j-FTC

Log4j-FTC-1