Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1598549D0 for ; Wed, 15 Jun 2011 16:21:06 +0000 (UTC) Received: (qmail 49098 invoked by uid 500); 15 Jun 2011 16:21:05 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 48980 invoked by uid 500); 15 Jun 2011 16:21:05 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Delivered-To: moderator for issues@commons.apache.org Received: (qmail 7247 invoked by uid 99); 14 Jun 2011 09:01:59 -0000 X-ASF-Spam-Status: No, hits=4.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RFC_ABUSE_POST,SPF_NEUTRAL,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 216.139.236.26 is neither permitted nor denied by domain of santhoshp2006@gmail.com) Date: Tue, 14 Jun 2011 02:01:32 -0700 (PDT) From: "santhoshp2006@gmail.com" To: issues@commons.apache.org Message-ID: <1308042092909-3596022.post@n4.nabble.com> Subject: in java apache.commons.io,how to avoid to read the old log messages. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit i am using the java Tail-listener API to do the tailf function(in Linux).ie,whenever log messages are updated in log file, this API will print the messages. My code is given below. public static void main(String[] args) { // TODO code application logic here File pcounter_log = new File("\vat\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); } } Initially its working fine.After some time,its reading the old log messages (log messages which are generated at the time of log filr creation.ie,starting of the log file). also its reading new log messages too. how to avoid to read the already monitored log messages.How to do this -- View this message in context: http://apache-commons.680414.n4.nabble.com/in-java-apache-commons-io-how-to-avoid-to-read-the-old-log-messages-tp3596022p3596022.html Sent from the Commons - Issues mailing list archive at Nabble.com.