From the docs
Spring boot will use Logback if its in the classpath. If you put a logback.xml
in the root of your classpath it will be picked up from there automatically.
You can customize this logback.xml
to provide your configurations for adding a rolling appender and so on based on your requirement. The documentation and the examples here will help you.
Update
You can even use log4j2 for logging. Just ensure that the correct dependencies are included. In that case, spring boot will check if there is a log4j2.xml
in the classpath. You can provide the required configurations using log4j2.xml
.