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

Allow configuring the max log files to keep #4777

Closed
evenyag opened this issue Sep 27, 2024 · 3 comments · Fixed by #4787
Closed

Allow configuring the max log files to keep #4777

evenyag opened this issue Sep 27, 2024 · 3 comments · Fixed by #4787
Labels
C-enhancement Category Enhancements good first issue Good for newcomers

Comments

@evenyag
Copy link
Contributor

evenyag commented Sep 27, 2024

What type of enhancement is this?

User experience

What does the enhancement do?

Currently, we don't limit the total number of log files. A long-running database may generate too many log files. We need to limit the max log files to keep by default.

Implementation challenges

The tracing-appender already supports setting the max log files. We can expose this in our LoggingOptions.
https://docs.rs/tracing-appender/latest/tracing_appender/rolling/struct.Builder.html#method.max_log_files

@evenyag evenyag added the C-enhancement Category Enhancements label Sep 27, 2024
@killme2008 killme2008 added the good first issue Good for newcomers label Sep 29, 2024
@Kev1n8
Copy link
Contributor

Kev1n8 commented Sep 29, 2024

I would like to give this a try. I wonder what number of the max_log_files by default is considered proper? @evenyag

@evenyag
Copy link
Contributor Author

evenyag commented Sep 30, 2024

I would like to give this a try. I wonder what number of the max_log_files by default is considered proper? @evenyag

We rotate files hourly, so it should have about 24 files per day (we only consider info logs). If we want to keep logs for 30 days, we can set the default to 720.

@Kev1n8
Copy link
Contributor

Kev1n8 commented Sep 30, 2024

take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category Enhancements good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants