开发者

How to avoid old log messages in TailerListener

开发者 https://www.devze.com 2023-03-03 17:00 出处:网络
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 displa

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

精彩评论

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