How to include Log4j2 messages in TestNG reporting

前端 未结 2 853
轻奢々
轻奢々 2021-02-09 20:20

I would like to have the Log4j2 logging information available in the TestNG reports for all of the test cases.

TestNG uses a special logger class called Reporter.java t

2条回答
  •  梦谈多话
    2021-02-09 20:55

    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    

    add this in pom.xml

    
            log4j
            log4j
            1.2.16
            compile
        
    

    then you can use log.info or log.error etc...

提交回复
热议问题