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

Make RollingFileAppender.RollOverRenameFiles virtual #205

Closed
FerdinandStapenhorst opened this issue Nov 3, 2024 · 3 comments · Fixed by #206
Closed

Make RollingFileAppender.RollOverRenameFiles virtual #205

FerdinandStapenhorst opened this issue Nov 3, 2024 · 3 comments · Fixed by #206
Assignees
Milestone

Comments

@FerdinandStapenhorst
Copy link

FerdinandStapenhorst commented Nov 3, 2024

This is a Feature Request

Compressing Rolled files in RollingFileAppender

I would like to be able to compress rolled files once thy are created. I don't see any way to get notified if a log file was rolled. Either a Callback or a protected override in the RollingFileAppender class signalling the log file rolling process, so I can interject and do a compression, would be great!

For example, it would be sufficient - I think - to change
protected void RollOverRenameFiles(string baseFileName)
to
protected virtual void RollOverRenameFiles(string baseFileName)

because then I could create a class

public class CompressingFileAppender : RollingFileAppender
{
  protected virtual void RollOverRenameFiles(string baseFileName)
  {
      // Do the compression stuff here...
  }
}

Ferdinand

@FreeAndNil
Copy link
Contributor

Hi @FerdinandStapenhorst,

I made the method virtual in #206.

Regards.

Next preview will arrive this week, 3.0.3 probably mid November.

@FerdinandStapenhorst
Copy link
Author

Thank you so much!

@FreeAndNil FreeAndNil changed the title Ability to compress rolled files Make RollingFileAppender.RollOverRenameFiles virtual Nov 4, 2024
@FreeAndNil
Copy link
Contributor

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 a pull request may close this issue.

2 participants