Added Feature: File size base log rotation#85
Open
ChrisHubinger wants to merge 7 commits into
Open
Conversation
Author
|
As I see from the Travic CI errors something in the test setup seeems to have changed from version 5 => 6,7.. as it complains about missing I failed with wrapping Any hint for me how i can fix that? |
Author
|
Are there any plans to get this reviewed? @ChrisHubinger meanwhile the version has changed to 4.3.0 so you could already rebase and update the version. Hopefully there will be some momentum on this. We could really use this feature, nice work btw! |
|
This would be fantastic to add like honestly this feature has been talked about for 7 years but never merged..... a lot of us would like it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
File size based log rotation
Motivation
In one of our Projects we need to implement log rotation to make sure the disk does not fill up.
As it seems not easily possible to simply use
logrotatefor that purpouse without the risk loosing events I've implemented afile size basedrotation directly in this plugin.Feature already in discussion here: #57
Configuration
Rotation is enabled by setting the parameter
file_rotation_sizeto a value > 0 (Default: 0) and otional set the parametermax_file_rotationto a non negative value to limit the number of created log files.keep_file_extension=>true, will prepend the rotation index before the file extension of the output path. Creating files like/path/to/logs/app.0.log/path/to/logs/app.1.log/path/to/logs/app.2.log...Implementation notes
The current file size is only checked when rotation is enabled.
The cleanup/housekeeping deletes only the last created file when limit has been reached e.g does not scvann folder for further files that may be deleted.
Tests
I added tests to validate the implementation, in a very similar way other features are tested
I'd be very happy to see this feature merged into upstream so that with future releases we do not need to ship our own version of the plugin anymore.
Please give me feedback if there is anything further i can do to get this PR accepted.
Thanks to you all for all the work on this great product.
Kind Regards,
Christian