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

前端 未结 15 1487
一向
一向 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 01:00

    I just used the Spring-boot provided logging mechanism. I wrote below in my 'logback.xml' file :

    
    
    
    
    
    
    
    
    

    I put the both application.properties and logback.xml file under same package 'src/main/resources'. In application.properties file just added one parameter :

    logging.file = xyz.log
    

    It worked perfectly fine for me.

提交回复
热议问题