Monthly Archives: November 2022

How to capture log events in tests with Log4j 2

Sometimes you want to verify that your program actually logs what it is supposed to be logging. When using Apache Log4j 2 as logging framework, it can be done like this: Include this dependency (for Maven, adjust appropriately for other … Continue reading

Posted in Java | Comments Off on How to capture log events in tests with Log4j 2