In a spring-boot application I can specify a custom log file with
java -jar spring-boot-app.jar --logging.file=/home/ubuntu/spring-boot-app.log
By default Spring Boot does not output logs to any file. If you want to have logs written in a file (in addition to the console output) then you should use either of logging.file or logging.path properties (not both).
In application.properties, just set:
logging.file=/home/ubuntu/spring-boot-app.log
This will create a spring-boot-app.log file under /home/ubuntu.