-
Is there a way to have |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
I am not sure what you want to do here. The simple answer is no, A slightly more complex answer is, yes, if the log file it is reading gets truncated and is restarted by the log writer, If you are experimenting, then the |
Beta Was this translation helpful? Give feedback.
-
I was considering using |
Beta Was this translation helpful? Give feedback.
-
It'll half-work, I think. When Depending on how the file is rewritten it might work well or go badly:
If you append your data to the file it'll just work because that's how logs tend to go. We could add a new flag that says this is not a log file, but a status file, and change the reader behaviour to cope with this mechanism. |
Beta Was this translation helpful? Give feedback.
-
Great, thank you for the information. Should I contribute to the development of this feature, or is it already planned for a future release? |
Beta Was this translation helpful? Give feedback.
-
This is not planned. You may send me some PRs if you like. |
Beta Was this translation helpful? Give feedback.
It'll half-work, I think.
When
mtail
starts, it'll go to EOF to start reading "new" log lines. So the current fields won't be read.Depending on how the file is rewritten it might work well or go badly:
mtail
will notice and start at zero to read the new file.mtail
will notice if the file offset is lower than the current position. Assuming you write mostly the same amount each time, this is probably going to end up with random successes and failures to read the new file.If you append your data to the file it'll just work because that's…