Place the file in src/main/resources . Java automatically looks for log4j2.xml in the classpath.
Ensure your application has write access to the logs/ directory defined in the RollingFile appender.
If you are looking to download or implement a log4j2.xml file, this guide provides the necessary templates and setup instructions. Standard log4j2.xml Template
💡 For local development, set the Root level to debug . For production environments, always use info or warn to keep log files manageable and performant.