How to configure rolling file appender within Spring Boot's application.yml

后端 未结 7 764
[愿得一人]
[愿得一人] 2020-12-01 17:35

Is is possible to configure a daily file appender within the application.yml of a Spring Boot application?

i.e. filenamePattern: myfile.%d{yyyy-MM-dd-HH-mm-ss}.log

7条回答
  •  既然无缘
    2020-12-01 18:29

    To override the default file appender and change it to daily rollover, you could use a logback-spring.xml looking like this:

    
    
        
        
        
    
        
            
                ${FILE_LOG_PATTERN}
            
            ${LOG_FILE}
            
                
                ${LOG_FILE}.%d{yyyy-MM-dd}.log
            
        
    
        
            
            
        
    
    
    

提交回复
热议问题