1

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.

Milad
  • 552
  • 1
  • 4
  • 20
  • @ShawnClarkYes I already came across to that, But my intention is to do it completely in Yaml without overriding the logback.xml. Not sure whether it's possible though. – Milad Aug 22 '16 at 07:24
  • 1
    It is not... You could put in a request to spring boot to add it but that type of feature is fairly specific to logback. Spring Boot tries to define settings that apply to multiple implementations of a feature. Example is the `logging.level.*`. That property can be applied to logback, log4j2, etc. – Shawn Clark Aug 22 '16 at 07:27

0 Answers0