Writing Test Case with Log4j logging posted on toolsqa.com

Hello Guys I understood the logic of TestNG Logging but it was told under toolsqa.com as below “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”

Could you please explain me the  xml file contents?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="fileAppender" class="org.apache.log4j.FileAppender">
<param name="Threshold" value="INFO" />
<param name="File" value="logfile.log"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c{1}] %m %n" />
<level value="INFO"/>
<appender-ref ref="fileAppender"/>
KG Train Asked on October 27, 2015 in Selenium WebDriver.
Add Comment
1 Answer(s)


Refer following links>>


Shubham89 Train Answered on November 12, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.