Skip to content
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

Custom rotate, archive and purge strategies for FileChannel #3810

Merged

Conversation

andrewauclair
Copy link
Contributor

This is an attempt at making an improved version of #3101 that has tests.

setRotationStrategy, setArchiveStrategy and setPurgeStrategy allow setting custom strategies to be used by the FileChannel.

These new functions take a non-null pointer and FileChannel owns the pointer after the call and will delete it when necessary.

Also changed FileChannel to use a new NullRotationStrategy and NullPurgeStrategy instead of null pointers.

One thing to note about these changes right now is that setting a property will still internally create a new strategy in FileChannel, overwriting the one provided to the set strategy functions. I think this is ok and I don't have any better ideas right now.

Personally, I've wanted this ability with Poco at work for a while so that we can start each log file with the version of software. It's currently difficult to know what version a customer is using when they send us log files.

@andrewauclair andrewauclair changed the title Adding the ability to set custom rotate, archive and purge strategies Custom rotate, archive and purge strategies for FileChannel Sep 22, 2022
@aleks-f
Copy link
Member

aleks-f commented Mar 17, 2023

@andrewauclair for some reason, this did not trigger CI builds. can you please push a dummy commit to trigger it so we can see it green before merge. I'll mark it for 1.13.0

@aleks-f aleks-f merged commit 66e93f9 into pocoproject:devel Mar 18, 2023
15 checks passed
aleks-f pushed a commit that referenced this pull request Nov 27, 2023
* Adding the ability to set custom rotate, archive and purge strategies.

* Force CI
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.

None yet

2 participants