I have a spring boot (1.4) project which in that there is application.yml
file which contains my configuration for Logback.
logging:
file: logs/%d{yyyy-MM-dd}.txt
rollingPolicy:
# daily rollover
fileNamePattern: logs/%d{yyyy-MM-dd}.txt
# log archives will be deleted after 6 months
maxHistory: 180
# total size of the log files can be at most 20GB
totalSizeCap: 20GB
pattern:
console: "%d %-5level %logger : %msg%n"
file: "%d %-5level [%thread] %logger : %msg%n"
by doing this I'm trying to make logback create a log file for everyday under logs folder but it doesn't create any files. If I change file: logs/%d{yyyy-MM-dd}.txt
to something static it creates a single file and doesn't separate the log entries in different files.
I want to do it completely in Yaml file not XML.