-
Notifications
You must be signed in to change notification settings - Fork 749
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
Size rolling #2904
base: master
Are you sure you want to change the base?
Size rolling #2904
Conversation
bf707aa
to
8ca4e2a
Compare
Hi @hawkw @davidbarsky @hds, What would it take to get this reviewed? Should I just close it since nobody will ever look at it? |
@x3ccd4828 I can look at this, but I'm currently very full up with family stuff, would you mind reminding me after the 25th of January? I'll be back at work then (and therefore at my computer) and will make some time to go through old PRs and issues. |
Tha is understandable, I will post here at the end of January |
8ca4e2a
to
90be4b4
Compare
90be4b4
to
65851cd
Compare
@hds I have rebased the branch would you be able to review it? |
This patch adds size-based rotation to tracing-appender.
Closes #1940
Closes #858
cc @hawkw @IniterWorker @CfirTsabari @davidbarsky @CBenoit
There is another pull request (#2497) for this feature but I thought I would try a different approach.
Motivation
In a constrained environment, we should be able to constrain the logging size and period.
Solution
Maximum bytes per log file may be specified in the
max_file_size
function when building the appender. The option will only be used when selectingRotation::SIZE
.File size is checked every write and if the size is exceeded the log file is rolled over.
None of the other rotation types use sub-seconds in the logfile name but for size-based rotation, I used it since there could be a plethora of writes in a short period and this was the simple way to ensure filename uniqueness otherwise it would write to the same file even if the size was exceeded. This is a limitation since I tried to use the same methodology as the time-based rolling without rewriting the architecture.