I was trying to log spring boot app logs to a file in Gradle.
Below is working for maven:
mvn spring-boot:run -Dspring-boot.run.profiles=it --log-file log.txt
This is my gradle startup command:
gradle.bat bootRun --args='--spring.profiles.active=it'