Log4j2 is working nicely with Spring Boot through the log4j2.xml configuration file in the root classpath, exactly as the documentation states.
log4j2.xml
When try
In case of property file:
java -Dlog4j.configuration=file:/path/to/log4j.properties -jar app.jar
To the command line works in Spring Boot 2. Don't forget to add file: before the path.