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
Spring Boot uses Commons Logging for all internal logging, but leaves the underlying log implementation open.
Default configurations are provided for Java Util Logging, Log4J, Log4J2 and Logback. In each case loggers are pre-configured to use console output with optional file output also available.
From the Spring Boot logging documentation.
The default log configuration will echo messages to the console as they are written. So until you explicitly specify a file as you described, it stays in the Console.