-
Notifications
You must be signed in to change notification settings - Fork 40.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify description of "logging.file.max-history" #17566
Comments
The default configuration is rotating files when the size limit is reached and this option is about the maximum number of archive files to keep. The default configuration is not doing daily rollovers. Even if it did, the official logback documentation is about the maximum number of files and doesn't mention how rotation is configured. Could you explain what lead you to think that there was a mistake in the docs? Maybe you're experiencing a different problem? |
I tested it in my environment. If I set max-history = 3, the logback will clear all logs of three days ago. |
Could you show your logging options? Did you have other logback configuration files? |
I only configure it in my bootstrap.yml,did'nt have any other configuration files.
|
Thanks for the info @lihongmingming ! Spring Boot is using Logback's SizeAndTimeBasedRollingPolicy, which means log files are rotated when the time limit has been reached - also, the log files are split to make sure that files don't exceed the maximum size. In our case, Spring Boot is using the following pattern This means that, for the following configuration, we might get 14 files if the application logs 20MB every 24hours (2x 10MB files per day): logging.file.max-history=7
logging.file.max-size=10MB This holds true, unless developers override the default logback configuration provided by Spring Boot. Closing in favour of #17567 |
I'm wondering if we shouldn't add support for |
Haven't you done this already? See 999780f. |
Right, thanks @prodingerd |
The max-history is the maximum retention days of the log,not number. so i think it will bring ambiguity
The text was updated successfully, but these errors were encountered: