How to Write Unit Tests for Logging 6 years ago
Log4J2 has a testing library that is pretty dope, you can use it to assert on log events and parameters passed and tweak your appenders so that you're not spamming the console while the test runs.
Here's the coordinates in gradle:
compile group: 'org.apache.logging.log4j', name: 'log4j-core', classifier: 'tests'