Im reading a log file in Java on a Linux box on a continual schedule of 2 minutes looking for certain messages. I store the last offset (RandomAccessFile getFilePointer) and read from it onwards when I detect LastModified has changed; is this best practice or even right?
Java – Parsing a Log File for Better Performance
javaperformance
Best Answer
Assuming the following:
You shouldn't have much to worry about. Just remember to close the file after reading it and to open it with "r" mode only.