How to increase QAF logging level

25 views Asked by At

We want to increase the logging level during the development stage, but log4J properties are not accepted in QAF, and the existing longing level is too low to understand the issue.We have tried in qaf version 3.2.0 & 4.0.0-RC2

Below is the log4j.properties file in the resource folder.

log4j.rootCategory=on
log4j.rootCategory=DEBUG
log4j.appender.console.Follow=true
log4j.logger.com.qmetry.qaf=TDEBUG
# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
log4j.logger.org.apache.axis.enterprise=DEBUG

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=DEBUG
log4j.appender.CONSOLE.Follow=true

log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%c{1}] - %m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=${outputDir}/isfw.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.Threshold=DEBUG
log4j.appender.LOGFILE.Follow=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=[%t] %d{HH:mm:ss,SSS} %-5p [%c] %m%n
#%-4r [%t] %-5p %c %x - %m%n

log4j.logger.com.qmetry.qaf.automation.integration=resultUpdationLog

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.resultUpdationLog=org.apache.log4j.FileAppender
log4j.appender.resultUpdationLog.File=resultUpdation.log
log4j.appender.resultUpdationLog.Append=true
log4j.appender.resultUpdationLog.Threshold=DEBUG
log4j.appender.resultUpdationLog.layout=org.apache.log4j.PatternLayout
log4j.appender.resultUpdationLog.layout.ConversionPattern=%-6r [%t] %-5p %c %x - %m%n

log4j.additivity.com.qmetry.qaf.automation.step=true
log4j.logger.com.qmetry.qaf.automation.step=DEBUG, SCENARIOLOGFILE
log4j.appender.SCENARIOLOGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.SCENARIOLOGFILE.File=${outputDir}/scenario.log
log4j.appender.SCENARIOLOGFILE.Append=true
log4j.appender.SCENARIOLOGFILE.Threshold=DEBUG
log4j.appender.SCENARIOLOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.SCENARIOLOGFILE.layout.ConversionPattern=%d{HH:mm:ss} %m%n

log4j.logger.com.qmetry.qaf.automation.ws=DEBUG, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.file=${outputDir}/ws.log
log4j.appender.file.MaxFileSize=1GB
log4j.appender.file.MaxBackupIndex=10
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.conversionPattern=%d{[dd.MM.yyyy] [HH:mm:ss]} %p [%t] %c (%F:%L) - %m%n


Below is the log4testng.properties

 log4testng.debug=true
 # Specifies the root Loggers logging level. Will log DEBUG level and above
 log4testng.rootLogger=DEBUG
 # The org.testng.reporters.EmailableReporter Logger will log TRACE level and above
 log4testng.logger.org.testng.reporters.EmailableReporter=TRACE
 # All Logger in packages below org.testng will log WARN level and above
 log4testng.logger.org.testng=WARN
 log4testng.logger.com.qmetry.qaf=DEBUG

Below is the pom.xml config:

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>${testSuiteFile}</suiteXmlFile>
                    </suiteXmlFiles>
                    <reportsDirectory>${test.results.dir}/${run.time}</reportsDirectory>
                    <systemPropertyVariables>
                        <org.uncommons.reportng.xml-dialect>testng</org.uncommons.reportng.xml-dialect>
                        <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>
                        <log4j.configuration>file:///${resource.dir}/log4j.properties</log4j.configuration>
                        <outputDir>${output.dir}</outputDir>
                        <test.results.dir>${output.dir}/html</test.results.dir>
                        <json.report.root.dir>${test.results.dir}</json.report.root.dir>
                        <json.report.dir>${output.dir}/json</json.report.dir>
                        <selenium.screenshots.dir>${output.dir}/img</selenium.screenshots.dir>
                        <selenium.screenshots.relative.path>../img</selenium.screenshots.relative.path>
                        <!--allure.results.directory>${project.basedir}/allure-results</allure.results.directory-->
                    </systemPropertyVariables>
                </configuration>
            </plugin>
0

There are 0 answers