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

Log deletion too greedy #195

Closed
gazpachoking opened this issue Dec 30, 2019 · 2 comments
Closed

Log deletion too greedy #195

gazpachoking opened this issue Dec 30, 2019 · 2 comments
Labels
enhancement Improvement to an already existing feature

Comments

@gazpachoking
Copy link
Contributor

Using the file sink, when loguru goes to clean up old logs due to retention setting. It is a bit too greedy with what it thinks are old logs. I am using the filename flexget.log, and the glob for deletion comes out to flexget.*. This strikes me as a bit greedy, and in my particular case it tries to delete a folder called FlexGet.egg-info (which is read only and causes a crash.) The two easy improvements I can see are:

  • Include the extension in the glob
  • Exclude folders
@Delgan Delgan added the enhancement Improvement to an already existing feature label Dec 30, 2019
@Delgan
Copy link
Owner

Delgan commented Dec 30, 2019

Good catch, thanks. The filenames can take many forms due to "{time}", rotation and compression. I will modify the collect of files based on your two suggestions. In the meantime, I guess you will need to manually re-filter and remove files using a custom retention function. 😉

@Delgan
Copy link
Owner

Delgan commented Jan 9, 2020

Closed by #196.

@Delgan Delgan closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an already existing feature
Projects
None yet
Development

No branches or pull requests

2 participants