I am using spring boot and as per spring documentation, we can define log file max size and log file max history by declaring below 2 properties in application.properties file.
logging.file.max-size and logging.file.max-history
https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/html/boot-features-logging.html
In my application.properties:
logging.file=/etc/myapp/myapp.log
logging.file.max-size=400KB
logging.file.max-history=20
When I use these properties, they don't seem to be working as expected. Like, for above mentioned properties, I was expecting log files to get rotated as soon the size reaches 400KB, but that doesn't happen.
To achieve this, I had to create logback-spring.xml and then declare appenders along with rolling policy etc. But, I do not want to do this, since it adds more configuration and an additional config file. I was hoping that I could use the out of box solution provided by spring logging, but for some reason it isn't working as mentioned in spring docs.