my code is given below .
public static void main(String[] args) {
// TODO code application logic here
File pcounter_log = new File("c:\development\temp\test.log");
try {
TailerListener listener = new PCTailListener();
Tailer tailer = new Tailer(pcounter_log, listener, 5000,true);
Thread thread = new Thread(tailer);
thread.start();
} catch (Exception e) {
System.out.println(e);
}
}
public class PCTailListener extends TailerListenerAdapter {
public void handle(String line) {
System.out.println(line);
}
}
.ie, i am monitoring the log file.whenever log messages updated in log file(c:\development\temp\test.log),it will print the log message.
The problem is,whenever log messages updated in log file,it displaying the same log message by two times and also some times by three or four times.how to avoid this duplicate log messages.