node-tail icon indicating copy to clipboard operation
node-tail copied to clipboard

Get the Last Position on unwatch

Open jaliph opened this issue 9 years ago • 4 comments

Can we have a last position on unwatch from where we can resume if we re watch the file again?

This feature will help in making the system fault tolerant. Please look into this.

jaliph avatar Aug 16 '16 05:08 jaliph

I'll think about it but I can't see any neat way to support this feature request and not breaking the current behaviour.

lucagrulla avatar Aug 28 '16 10:08 lucagrulla

Thanks a lot for considering it.

Have a look into this : https://github.com/mingqi/tailF

It has something "unwatch" and position to continue with it later.

jaliph avatar Aug 29 '16 10:08 jaliph

Hi,

Thanks for the link.

That way it's implemented in that library it's not making the system fault tolerant. Given it has to be an explicit call to unwatch to get the latest known position that won't happen in the scenario of a system crash. What is the actual behaviour you're looking for? Can you describe me the use cases?

lucagrulla avatar Aug 30 '16 21:08 lucagrulla

The actual use case is about having a a log reader dynamically.. But incase the file is not getting modifed for long or SIGTERM is received, we can unwatch it and start again from the same instance.

Thus we can maintain a consistency while reading logs.

jaliph avatar Aug 31 '16 04:08 jaliph