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

Fix logger initialization on readonly filesystems #2391

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vnuka-n
Copy link

@vnuka-n vnuka-n commented Oct 4, 2024

Calling RollingFileAppender::new tries to create the directory for the log files even though logging is turned off by Logger.init('off', null). This change simply postpones the initialization of RollingFileAppender until it is actually needed. This way if we do eg. Logger.init("info", null) it works as expected and does not throw an error on readonly filesystems.

Fixes #2387

Calling RollingFileAppender::new tries to create the directory for the log files even though logging is turned off by Logger.init('off', null). This change simply postpones the initialization of RollingFileAppender until it is actually needed. This way if we do eg. Logger.init("info", null) it works as expected and does not throw an error on readonly filesystems.

Fixes valkey-io#2387
@avifenesh
Copy link
Collaborator

avifenesh commented Oct 4, 2024

Thanks for taking the initiative! Appreciate that!

I didn't get deeply into it yet (holidays), but at first glance, it seems good, i thought also to look for a lazy appender solution.

As long as it's not urgent to you guys I'll review it on Sunday. Let me know if it is.

If you want in the meantime to add the implementation of error handling in write-only systems you are welcome to add it to the PR.

For passing CI you need to sign your commits.

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.

Client panics when initializing on a read only filesystem
2 participants