Skip to content

Implement native size/time log rotation with gzip compression#189

Open
Anyitechs wants to merge 1 commit intolightningdevkit:mainfrom
Anyitechs:log-rotation
Open

Implement native size/time log rotation with gzip compression#189
Anyitechs wants to merge 1 commit intolightningdevkit:mainfrom
Anyitechs:log-rotation

Conversation

@Anyitechs
Copy link
Copy Markdown
Contributor

@Anyitechs Anyitechs commented Apr 15, 2026

This updates the ServerLogger to track file size and age internally, triggering rotation at 50MB or 24 hours. Old logs are now compressed in the background using native OS gzip via std::thread::spawn, eliminating the need for the user to configure logrotate.

Disk writes are also now buffered for better runtime performance.

@ldk-reviews-bot
Copy link
Copy Markdown

ldk-reviews-bot commented Apr 15, 2026

🎉 This PR is now ready for review!
Please choose at least one reviewer by assigning them on the right bar.
If no reviewers are assigned within 10 minutes, I'll automatically assign one.
Once the first reviewer has submitted a review, a second will be assigned if required.

@Anyitechs Anyitechs marked this pull request as draft April 15, 2026 19:35
@benthecarman
Copy link
Copy Markdown
Collaborator

I would rather keep the old version. I like all the handling for the different signals in main.rs, makes things easier to reason about imo.

Update the ServerLogger to track file size and age internally,
triggering rotation at 50MB or 24 hours. Old logs are now compressed
in the background using native OS gzip via `std::thread::spawn`,
eliminating the need for the user to configure `logrotate`.
Disk writes are also now buffered for better runtime performance.

Co-Authored-By: Gemini 3.0 Pro
@Anyitechs Anyitechs changed the title refactor: encapsulate log rotation logic Implement native size/time log rotation with gzip compression Apr 17, 2026
@Anyitechs Anyitechs marked this pull request as ready for review April 17, 2026 19:58
@Anyitechs
Copy link
Copy Markdown
Contributor Author

I would rather keep the old version. I like all the handling for the different signals in main.rs, makes things easier to reason about imo.

As we discussed elsewhere, this is now dropped entirely as we're moving to doing the rotation ourselves rather than relying on the user to configure logrotate.

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.

3 participants