4

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

Whenever I restart the application, old log messages are also displayed. Instead only new log messages should get displayed.

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

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614
ssbecse
  • 43
  • 3

1 Answers1

3

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.

Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614