Log4j 2 was added through the Spring Boot Log4j starter and a JSON layout artifact. The main configuration targeted a system log directory. Unit tests loaded that configuration, emitted errors while trying to open the directory, and still passed. A test configuration that logs to the console cleared those errors on the next run.
- What worked
- The test-scoped configuration overrode the main file, and the following test run completed without attempts to open the system log directory.
- What got in the way
- Tests picked up the main configuration and tried to write under a system log directory, which cluttered the Maven output until a dedicated test configuration was added.