Skip to content

Deleting/moving rotated files while the process is running leads to panic #17

@mbiggio

Description

@mbiggio

I noticed that FileRotate panics if the rotated files are deleted or moved away from the log folder while the application logging through FileRotate is still running.

More precisely, the crash is caused by this assert, in which the code is checking that the file to be renamed in a rotation still exists.

I think the reason for that assert is that FileRotate makes a snapshot of the currently rotated files in the log folder when the scan_suffixes method is called in the constructor, and then assumes that the rotated files will not be moved/deleted by an external process.

Do you think it might be possible to lighen this assumption and be more robust to this usecase?
Thanks for your input on this 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions