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

Deleting old rolling file logs #24

Closed
ShadowDancer opened this issue Aug 28, 2020 · 2 comments
Closed

Deleting old rolling file logs #24

ShadowDancer opened this issue Aug 28, 2020 · 2 comments
Labels
stale stale not updated issue & pr

Comments

@ShadowDancer
Copy link

ShadowDancer commented Aug 28, 2020

RollingFile should have limits, like last month, or 1gb max, to not drain disk space on customers machine. I think this is critical to have if this lib is meant to be used in production environments.

The generated files will not be deleted. If you want to do a log rotation, please do it from outside.

I think this is not good way to deal with log rotation. Especially if you have something misbehaving (generating lots of logs), the only solution is to react before disk fills up.

To solve this from outside it would be really hard to get right, as it cannot be just solved with cron job, it needs active monitoring and dealing with locked files, whereas log process already knows file masks and can correctly compute file sizes and stop logging when attempting to roll.

I think the right thing to do is stop logging, because if something is misbehaving and creating lots of log files probably cause of the problem is much more useful. If logger would remove younger logs, it could hide the cause of problem with lots of gibberish.

@neuecc
Copy link
Member

neuecc commented Aug 30, 2020

A classic practice is to monitor it externally, which I believe is possible.
However, this is certainly cumbersome.
Shall we add a retainedFileCountLimit?

@github-actions
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the stale stale not updated issue & pr label Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale stale not updated issue & pr
Projects
None yet
Development

No branches or pull requests

2 participants