Spring Boot - no log file written (logging.file is not respected)

前端 未结 15 1495
一向
一向 2020-12-14 00:01

I use Spring Boot and want it to write log output to a file.

According to the docs, this is simply done by setting

logging.file=filename.log
<         


        
15条回答
  •  不知归路
    2020-12-14 00:53

    I run my spring boot service using command line argument which works fine. All the spring boot console log writes to the file. I don't have any logging configured in my application.properties file. Spring boot version: 2.0.5.RELEASE

    In windows:

    java -jar target\microservice-0.0.1.jar --logging.file=C:\\logs\\microservice.log
    

    In Linux

    java -jar target\microservice-0.0.1.jar --logging.file=\var\log\microservice.log
    

提交回复
热议问题