spring-boot default log location

后端 未结 3 769
慢半拍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:16

    By default, Spring Boot logs only to the console and does not write log files. If you want to write log files in addition to the console output, you need to set a logging.file or logging.path property (for example, in your application.properties).

    Below codes in your application.properties will write the log into /home/user/my.log:

    logging.path = /home/user
    logging.file = my.log
    

提交回复
热议问题