I am trying to integrate Log4J into my tests that use TestNG, I have added a logger, but when I try to use it I don't get any output.
I am using the JDK 18, latest stable TestNG and Log4J core.
public abstract class DemoAutomationTest extends AbstractTest {
private Logger logger = null;
@BeforeSuite
@Override
protected void suiteSetup() {
String testName = this.getClass().getCanonicalName();
this.logger = LogManager.getLogger(testName);
this.logger.info("Test info");
}
}
Any help would be appreciated, I have looked this up here, on Stack Overflow and can't find an answer.
The structure is:
automation
src
test
java
framework
testng
DemoAutomationTest.java
AbstractTest.java
tests
demo.java
pom.xml