Skip to content

Adding log rotation using lumberjack#423

Open
sergey3bv wants to merge 2 commits intoElementsProject:masterfrom
sergey3bv:feat/log-rotation
Open

Adding log rotation using lumberjack#423
sergey3bv wants to merge 2 commits intoElementsProject:masterfrom
sergey3bv:feat/log-rotation

Conversation

@sergey3bv
Copy link
Copy Markdown

@sergey3bv sergey3bv commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

@YusukeShimizu YusukeShimizu left a comment

Choose a reason for hiding this comment

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

Thank you for the log rotation update; this is a valuable improvement overall.
I have one concern that looks blocking, so I’m marking this as request changes for now and would appreciate a quick confirmation.

@sergey3bv
Copy link
Copy Markdown
Author

sergey3bv commented Mar 3, 2026

Hey, @YusukeShimizu, I updated the PR accordingly, could you please review it? Also are there any issues I can help with?

@sergey3bv sergey3bv force-pushed the feat/log-rotation branch from 659b3f0 to eda6a6e Compare March 4, 2026 12:30
@YusukeShimizu
Copy link
Copy Markdown
Contributor

Thanks for addressing the earlier feedback and improving the log rotation overall!

If my understanding is correct, there are two points we might need to address before merging:

  1. Existing nodes currently use /log as a file, but it looks like this PR changes the same path into a directory. Please correct me if I'm wrong, but wouldn't this cause an in-place upgrade to fail at startup? We might need to add a migration step for the old file or keep the path backward-compatible.

  2. It seems logrotation.maxsize, maxbackups, and maxage are being accepted without validation. I'm concerned that invalid values (especially maxsize <= 0) could silently break file logging rather than failing fast at startup.

Let me know your thoughts on this!

@sergey3bv
Copy link
Copy Markdown
Author

  1. Existing nodes currently use /log as a file

As I am thinking about it now we can leave the current flow and store rotated logs nearby. For example, logs will still be written in log and rotated ones will be in rotated_logs or even in user provided location. This way PR will produce less friction, what do you think?

@sergey3bv
Copy link
Copy Markdown
Author

2. I'm concerned that invalid values (especially maxsize <= 0) could silently break file logging

Good point, I will fix it right away

@YusukeShimizu
Copy link
Copy Markdown
Contributor

That sounds like a good direction to me. Keeping the active log at the current /log path would avoid the upgrade compatibility issue, and it should reduce friction for existing deployments.

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