Hi @mauroasilva 

The problem on resume lies here. This offset is the authoritative offset - it counts exactly the location in the file. However, in block 74-77 above, you strip the new lines from text, so this only increments the file offset by the length of the line without the new lines.

Thus, every event causes this offset to be off by another 1 each time. Eventually it will be off significantly.

Note that the offset is incremented after the FileEvent is channeled to registrar. So registrar needs to reproduce this calculation, but it cannot. In #164 it doesn't matter so much, because each time, it will be 1 off only. On Windows this means on resume an empty event is flushed and that's it. That's because this offset is only ever one line behind. But with yours because you don't include new lines ever, it gets further and further behind each time.

Hope this makes sense.

I did significant work in #151 to make everything work properly (there were many bugs in handling of files on Windows and handling of resume and rotations). In that PR I also switched this line around so offset is incremented before the FileEvent is flushed. That, combined with #164, fixes the issue completely and means on Windows you don't get an empty event on resume.

Jason