Skip to content

File destination flush signal#17

Merged
MrAnno merged 5 commits intoMrAnno:file-rotation-skeletonfrom
shikharvashistha:file-rotation-skeleton
Aug 27, 2022
Merged

File destination flush signal#17
MrAnno merged 5 commits intoMrAnno:file-rotation-skeletonfrom
shikharvashistha:file-rotation-skeleton

Conversation

@shikharvashistha
Copy link

This pull introduces file rotation mechanism to syslog-ng

@github-actions
Copy link

No news file has been detected. Please write one, if applicable.

@MrAnno MrAnno force-pushed the file-rotation-skeleton branch from 69d0df2 to ca67f18 Compare August 2, 2022 18:21
@MrAnno MrAnno force-pushed the file-rotation-skeleton branch from 9ed269a to 1f3568f Compare August 2, 2022 18:27
@MrAnno
Copy link
Owner

MrAnno commented Aug 2, 2022

Our commit message template is the following:

modulename: short description of the commit

optional longer description

Signed-off-by: Name <email>

Marking bug/fix/chore is a good practice, but we start with the module's name instead.
In our case, affile and file-rotation.

@shikharvashistha shikharvashistha force-pushed the file-rotation-skeleton branch 2 times, most recently from fec0a5a to d8f24cd Compare August 4, 2022 13:41
@shikharvashistha shikharvashistha requested a review from MrAnno August 4, 2022 13:42
@shikharvashistha
Copy link
Author

Hi, @MrAnno, I'm unable to see these conflicts locally don't know why these are there.

@MrAnno
Copy link
Owner

MrAnno commented Aug 4, 2022

I can't review this. Please fix the git history.
I'm happy to help with git rebase or anything, we can talk about it on Gitter.

@MrAnno MrAnno removed their request for review August 4, 2022 13:59
Copy link
Owner

@MrAnno MrAnno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also clicked "unresolve" on 3 of my previous notes. Those notes try to explain why this does not work.

Also, I can't compile the current version of this branch, file-signals.h is missing from this patchset, it is probably a rebase issue.

@shikharvashistha
Copy link
Author

I've also clicked "unresolve" on 3 of my previous notes. Those notes try to explain why this does not work.

Also, I can't compile the current version of this branch, file-signals.h is missing from this patchset, it is probably a rebase issue.

Yeah because it didn't got commited used git add -u

@MrAnno MrAnno changed the title feat: file rotation plugin File destination flush signal Aug 23, 2022
@shikharvashistha shikharvashistha force-pushed the file-rotation-skeleton branch 3 times, most recently from 887c2aa to 17b7c82 Compare August 26, 2022 12:03
This commit adds signal to the file destination involving passing AFFileDestDriver's instance signal slot connector to the LogProtoFileWriter

Signed-off-by: Shikhar Vashistha <[email protected]>
This commit introduces new option to set interval for log rotation

Signed-off-by: Shikhar Vashistha <[email protected]>
This commit introduces the controller function for updating/set log rotation interval & Adds support code for connecting AFFileDestDriver plugin's signal_slot_connector to our plugin

Signed-off-by: Shikhar Vashistha <[email protected]>
…in test for set_interval

This commit updates the location of plugin's request payload and the SIGNAL which is required to be emitted

Signed-off-by: Shikhar Vashistha <[email protected]>
Copy link
Owner

@MrAnno MrAnno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proto constructor signature change hasn't been followed in our unit tests, please fix them there as well.

https://github.com/MrAnno/syslog-ng/runs/8036247829?check_suite_focus=true

@shikharvashistha shikharvashistha force-pushed the file-rotation-skeleton branch 2 times, most recently from 9983d33 to f4dab3f Compare August 27, 2022 07:10
@MrAnno
Copy link
Owner

MrAnno commented Aug 27, 2022

There is one remaining CMake build issue in the CI:

[ 80%] Building C object syslog-ng-ctl/CMakeFiles/syslog-ng-ctl.dir/syslog-ng-ctl.c.o
/__w/syslog-ng/syslog-ng/modules/file-rotation/file-rotation.c:25:10: fatal error: 'modules/affile/file-signals.h' file not found
#include "modules/affile/file-signals.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can fix this by adding the following to modules/file-rotation/CMakeLists.txt:

--- a/modules/file-rotation/CMakeLists.txt
+++ b/modules/file-rotation/CMakeLists.txt
@@ -15,6 +15,7 @@ add_module(
   TARGET file_rotation
   GRAMMAR file-rotation-grammar
   SOURCES ${FILE_ROTATION_SOURCES}
+  INCLUDES ${PROJECT_SOURCE_DIR}
 )

@shikharvashistha shikharvashistha force-pushed the file-rotation-skeleton branch 2 times, most recently from e975796 to 5803475 Compare August 27, 2022 17:51
@shikharvashistha
Copy link
Author

There is one remaining CMake build issue in the CI:

[ 80%] Building C object syslog-ng-ctl/CMakeFiles/syslog-ng-ctl.dir/syslog-ng-ctl.c.o
/__w/syslog-ng/syslog-ng/modules/file-rotation/file-rotation.c:25:10: fatal error: 'modules/affile/file-signals.h' file not found
#include "modules/affile/file-signals.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can fix this by adding the following to modules/file-rotation/CMakeLists.txt:

--- a/modules/file-rotation/CMakeLists.txt
+++ b/modules/file-rotation/CMakeLists.txt
@@ -15,6 +15,7 @@ add_module(
   TARGET file_rotation
   GRAMMAR file-rotation-grammar
   SOURCES ${FILE_ROTATION_SOURCES}
+  INCLUDES ${PROJECT_SOURCE_DIR}
 )

Yeah I've added it to CMakeLists.txt

This commit assigns the AFFileDestDriver signal_slot_connector to the logproto's file writer struct

Signed-off-by: Shikhar Vashistha <[email protected]>
@MrAnno MrAnno merged commit f8f2e1e into MrAnno:file-rotation-skeleton Aug 27, 2022
MrAnno added a commit that referenced this pull request Aug 27, 2022
MrAnno added a commit that referenced this pull request Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants