Skip to content

Conversation

RopoMen
Copy link

@RopoMen RopoMen commented Feb 16, 2023

Currently this library is not emitting logRemoved event for files inside Audit JSON which are actually deleted from disk.

This causes issues for example in winston-daily-rotate-file which is providing gzip functionality and it compresses the original log files and then removes them from disk.

Now, because this remove event is not emitted winston-daily-rotate-file cannot delete those .gz files.

It is safe to emit this event because original log file is deleted. Whether deletion is done by file-stream-rotator or someone else.

@chrisstoy
Copy link

Is this ever going to be merged? Without this, winston-daily-rotate-file is essentially broken.

@rogerc
Copy link
Owner

rogerc commented Jun 22, 2025

The library emits the deleted file event when it is itself that deleted the file. If someone or something else deleted or renamed the file directly on disk, I won't notify of an external change, it will just remove the line from the audit log.

Does the gzip Winston library rename the file when zipped? If it does, the gzip library should handle its own audit log and delete accordingly.

I can look at adding a new event to notify that file was removed by 3rd party from disk, for completeness if someone wants to keep track of that.

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.

3 participants