Search code examples
javaseleniumselenium-webdrivertestnglog4j2

How to remove unnecessary logs from log4j2 log's file


I want to remove the unnecessary log's that are generated automatically by log4j when i run my suite, I only want the log's which i wrote in the code, please help.

enter image description here

As you can see my actual log's starts from Launched flipcart.com and end with Closed the current window Also check the log4j2.xml file.

enter image description here


Solution

  • See second answer in How to exclude a single Class from a Log4j Logger / Appender?

    Replace

    <logger name="com.example.FifthClass">
        <level value="FATAL"/>
    </logger>
    

    with e.g.

    <logger name="io.netty">
        <level value="FATAL"/>
    </logger>