开发者

How to avoid old log messages in TailerListener

I am using the Apache Commons Tailer API to monitor the log files.

Whenever I restart the application, old log messa开发者_C百科ges are also displayed. Instead only new log messages should get displayed.

How do I avoid this behavior of getting the old log messages?


Did you use the 4-argument Tailer constructor and pass true for the last argument (end)? This should make sure that only new lines are returned.

The last argument is documented like this:

Set to true to tail from the end of the file, false to tail from the beginning of the file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜