rogerc / file-stream-rotator

NodeJS file stream rotator
MIT License
143 stars 69 forks source link

Emit 'logRemoved' event for files which are removed from disk #100

Open RopoMen opened 1 year ago

RopoMen commented 1 year ago

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.