File size checking & log-file reopening #18
File size checking & log-file reopening #18shikharvashistha wants to merge 9 commits intoMrAnno:file-rotationfrom
Conversation
|
No news file has been detected. Please write one, if applicable. |
This commit introduces functionality for setting up date format based of last_rotation_time Signed-off-by: Shikhar Vashistha <[email protected]>
8de05cb to
0226a54
Compare
This commit includes the file size checking and renaming if it exceeds the desired size Signed-off-by: Shikhar Vashistha <[email protected]>
49db888 to
5b0cd3e
Compare
This commit introduces few fixes to file size checking and rotation including reopening the log file based of the request Signed-off-by: Shikhar Vashistha <[email protected]>
79dac81 to
ccd0062
Compare
This commit adds functional test for file-rotation plugin Signed-off-by: Shikhar Vashistha <[email protected]>
ccd0062 to
091baf6
Compare
Added file reopener struct to file-signal.h Signed-off-by: Shikhar Vashistha <[email protected]>
This commit adds reopening of a file via a flush signal Signed-off-by: Shikhar Vashistha <[email protected]>
This commit adds the functionality to reopen the destination file via reopener Signed-off-by: Shikhar Vashistha <[email protected]>
2b4530d to
fdd42ce
Compare
e7f38b7 to
cf12e49
Compare
|
|
||
| g_free(new_filename); | ||
|
|
||
| self->number_of_time_rotated++; |
There was a problem hiding this comment.
As I see you've started working on the rotate() option. The implementation of this option is not trivial: we need to check already existing files and take actions based on what we found in the directory: rename existing 1, 2, 3-suffixed files so that we can use the "1" prefix for the currently rotated file, delete the file that falls out of the rotate(N) range, etc.
An in-memory counter is not enough here, as we'd accidentally override existing files after restarting syslog-ng.
(I'm more than happy if you're willing to work on it, but I'd like to mention that it's not a requirement for the project.)
There was a problem hiding this comment.
Thank you, it is starting to take shape. number_of_time_rotated is still a memory-only value, this feature should work properly between restarts too, which requires checking already existing rotated files on the disk.
cf12e49 to
581d2c2
Compare
This commit introduces a new option to set number of file rotations possible and few validation checks Signed-off-by: Shikhar Vashistha <[email protected]>
581d2c2 to
51bb5fe
Compare
|
Hi @MrAnno, can we consider winding up the project? |
There was a problem hiding this comment.
Thank you.
Please consider fixing the above additional review notes (or reverting back to the non-rotate() version of the PR.
After that, please open a pull request against syslog-ng/syslog-ng.
Please don't forget to read our contribution guide, especially the section about pull requests:
https://github.com/syslog-ng/syslog-ng/blob/master/CONTRIBUTING.md#pull-requests
A few rounds of review will be done there too.
That may slip past the project timeline, but I hope you will still be available from time to time.
|
|
||
| g_free(new_filename); | ||
|
|
||
| self->number_of_time_rotated++; |
There was a problem hiding this comment.
Thank you, it is starting to take shape. number_of_time_rotated is still a memory-only value, this feature should work properly between restarts too, which requires checking already existing rotated files on the disk.
This commit introduces checking file everytime on disk Signed-off-by: Shikhar Vashistha <[email protected]>
Yeah I'll be available for the review |
This pull implements the functionality to check file size for rotation & reopening if required.