I need to monitor a log file for a pattern. The log file continually gets written by an application.

  1. The application can add new log statements while my program is reading it.
  2. The log gets rolled over when it’s >200 MB or at end of the day, so my program should handle change in filename dynamically.
  3. If my program crashes for any reason, it has to resume from where it left off.

I do not want to re-invent the wheel. I am looking for a Java API. I wrote a program to read file and put in a loop with 30 seconds sleep, but that does not meet all the criteria.

Edit
Report