Apache Commons IO Tailer example
I am working on a monitoring program that reads the /var/log/auth.log file. I am using Apache Commons IO Tailer class to read the file in real time. To get started, I wanted to test the real-time reading part on a simple file, and manually enter some code in the console line. Here is my code: public class Main { public static void main(String[] args) { TailerListener listener = new MyListener(); Tailer tailer = Tailer.create(new File("log.txt"), listener, 500); while(true) { } } } public class MyListener extends TailerListenerAdapter { @Override public void handle(String line) { System.out