spring-boot default log location

后端 未结 3 772
慢半拍i
慢半拍i 2020-12-08 06:53

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

3条回答
  •  甜味超标
    2020-12-08 07:13

    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.

提交回复
热议问题