-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Use SizeAndTimeBasedRollingPolicy for default file appender
#6352
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
Conversation
|
This PR also addresses #4379. Nice to see this was taken into consideration and labeled as With console output being advocated as preferred logging option feeling is that Boot is (perhaps understandably) tilted towards cloud environments but IMO does not offer the greatest support for running as Linux service. Well behaved and system friendly Linux services should actually log minimal output to console which is related to the state of the service itself (starting, started, stopping... etc) since that output is generally redirected to system log. Talking in terms of systemd, which is AFAIK the most popular init service in current version of most major Linux distros ATM, console output automatically ends up in journal logging system and the latest entries can be observer upon inspecting service status using Actual logs regarding the domain of the service in subject should actually end up in different place, which is generally Regarding the separation/filtering of console and file logs, I've also created #6366 which addresses that part and should perhaps be considered together with this change. Since I've already gone at length about what I'd expect to be able to easily configure regarding logging, I'd also like to reiterate some thoughts about logging system management already expressed in this comment and addressed by #4486. |
|
I was looking to merge this in 1.4 but I'm getting worried that we're starting to add complexity to the logging system and ultimately duplicating the Things that are of particular concern:
Thanks for all your efforts here. I'm sure that we'll be able to do something for 1.5, I just don't want to rush to add something in 1.4 that we might later prefer was fixed in a different way. |
|
Thanks for your feedback. When creating this PR and #6366 I thought the target release would be 1.5 since they both introduce new configuration properties so 👍 from me on not rushing things. Since Boot offers a very nice support for installing apps as Linux services with minimal effort, IMO it makes sense to provide adequate logging support for such use-case too rather than having to resort to manual logging configuration. So I primarily see this as providing support for this fairly common use-case rather than
Personally I'm in favor of grouping thing like
I think not. OTOH
This is correct. |
9cdead7 to
a2301db
Compare
|
@philwebb Could you provide an update on status of this (and related issues), considering it was recently removed from the 1.5 milestone? |
|
Sorry @vpavic, I should have added a comment when I removed the target milestone. We did some planning for the next Spring Boot versions and realized that it was quite critical to try and get Boot 2.0 out not long after Spring 5 so that people can try the reactive web framework. In order to give ourselves as much time as possible we decided to make Spring Boot 1.5 as light as possible (it will mainly be version updates and few minor improvements). Our plan is now to branch the code after we release 1.4.1. Master will be for 2.0 work, and we'll create a Once v2.0.0.M1 is released (with all the breaking changes we want to make), we'll go back and sweep the issue tracker for pull-requests and additional issues that seem feasible. I'm really sorry to leave this one hanging again. Once all the high risk 2.0 work is out the way, we should have a bit more time. |
|
@philwebb Thank you for the detailed insight into plans for the upcoming Spring Boot versions. It's very much appreciated! This information is valuable to me since we usually align our projects against a certain version of Spring Boot, taking into account our target delivery dates and expected GA date for a given Spring Boot version. I wonder if this kind of info could be made available on project's wiki, or perhaps blog, to supplement the projections from the milestones page? I guess your comment here also covers some of the other PR's I've proposed, whose status I had planned to inquire about as well. Thanks again. |
|
👍 for logging.file.max-size |
|
@vpavic Do you care to solve the merging conflict that this PR seems to have? |
|
@iNikem Since this PR is targeted at 2.0.0.M4 milestone, which is scheduled for August 7th ATM, there's plenty of time to resolve the conflicts. |
125fd0b to
204910b
Compare
Previously, `FixedWindowRollingPolicy` with size limit of 10 MB was used as default file appender. This commit changes the default file appender to use `SizeAndTimeBasedRollingPolicy` and introduces two new properties to improve log file configuration capabilities - `logging.file.max-history` to limit the number of archive log files to keep and `logging.file.max-size` to limit the log file size.
|
Thanks once again @vpavic ! |
Update the logback file appender to use `SizeAndTimeBasedRollingPolicy`
rather than `FixedWindowRollingPolicy`.
Add two new properties to improve log file configuration capabilities:
- `logging.file.max-history` to limit the number of archive log files
to keep.
- `logging.file.max-size` to limit the log file size.
See gh-6352
* pr/6352: Polish SizeAndTimeBasedRollingPolicy changes Use SizeAndTimeBasedRollingPolicy file appender
As described in #5590,
FixedWindowRollingPolicywith size limit of 10 MB is used in the default file appender.This PR changes the default file appender to use
SizeAndTimeBasedRollingPolicyand introduces two new properties to improve log file configuration capabilities -logging.file.max-historyto limit the number of archive log files to keep andlogging.file.max-sizeto limit the log file size.Previous size limit of 10 MB is retained as the default and daily rollover is used for time limit.