Please check Spring Boot logging documentation.
All modern logging frameworks supported by Spring Boot such as Logback or Log4j are super-easy to configure for such cases...
For example using Logback you would do something like that :
<configuration>
<appender name="FILE" class="ch.qos.logback.core.rolling.FilAppender">
<file>/var/log/my-app.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg%n</pattern>
</encoder>
</appender>
<root level="INFO">
<appender-ref ref="FILE" />
</root>
</configuration>
You can also check this other answer to suppress all logback output to console, mine is just an example.