spring-boot default log location

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

    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.

提交回复
热议问题