Return-Path: Delivered-To: apmail-logging-log4net-user-archive@www.apache.org Received: (qmail 64127 invoked from network); 28 Jan 2006 18:50:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Jan 2006 18:50:51 -0000 Received: (qmail 2442 invoked by uid 500); 28 Jan 2006 18:50:49 -0000 Delivered-To: apmail-logging-log4net-user-archive@logging.apache.org Received: (qmail 2410 invoked by uid 500); 28 Jan 2006 18:50:48 -0000 Mailing-List: contact log4net-user-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET User" List-Id: Delivered-To: mailing list log4net-user@logging.apache.org Received: (qmail 2399 invoked by uid 99); 28 Jan 2006 18:50:48 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jan 2006 10:50:48 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [68.142.207.140] (HELO web32209.mail.mud.yahoo.com) (68.142.207.140) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 28 Jan 2006 10:50:47 -0800 Received: (qmail 27195 invoked by uid 60001); 28 Jan 2006 18:50:27 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=BhY19gSBHAudkXhjrDY4DxLzdgxFYXZnfLBZSMtrhHU7xrAieUEW0S+qE8EsiERqoaMWKZny1NSmQs7AG9wPvf7J5u0bSeUEIy+vLFvCnA1bHxUTm6EcomQX1pc0R1S+M3kv3qYdb3+bQE+oGE4DrlVg864LYjKc5T1TQ2m35tY= ; Message-ID: <20060128185027.27193.qmail@web32209.mail.mud.yahoo.com> Received: from [65.24.255.41] by web32209.mail.mud.yahoo.com via HTTP; Sat, 28 Jan 2006 10:50:27 PST Date: Sat, 28 Jan 2006 10:50:27 -0800 (PST) From: Ron Grabowski Subject: Re: Repeat ignores messages To: Log4NET User In-Reply-To: <43DB5A49.3020600@vianett.no> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Here's a filter that ignores messages that contain the same exception within a defined time period. For example if 500 identical log messages are recieved within in 1 second time period only the first log message is recorded: http://tinyurl.com/cbq82 http://www.mail-archive.com/log4net-user%40logging.apache.org/msg02517.html I understand how a simple counter variable could be used to keep track of the number of repeated messages, but I still don't understand where this log message will be generated: Last message was repeated 2 times. When the timer inside the filter expires? --- Morten Andersen wrote: > Your code was not generating any repeated lines. A repeated line is > only > true if the last logged line on the appender is the same. There > should > be no memory issues because it is just a checksum of the last logged > line, and two datetime variables that is stored. One datetime for the > > first, and one that changes every time the line is repeated. When a > different checksum occurs the last checksum, and the two datetime > values > is replaced. > > There should also be a timeout value. In my example I have a 10 > second > timeout. > > Code: > log.Debug("Hello world"); > log.Debug("Hello world"); > log.Debug("Hello world"); > Thread.Sleep(10500); > log.Debug("Hello world"); > > Output: > Hello world > Last message was repeated 2 times. > Hello world > > - Morten > > Ron Grabowski wrote: > > Do you want to keep a count of every unique log message and append > that > > to the message? > > > > Code: > > log.Debug("A"); > > log.Debug("AB"); > > log.Debug("ABC"); > > log.Debug("ABCD"); > > log.Debug("A"); > > log.Debug("AB"); > > log.Debug("ABC"); > > log.Debug("ABCD"); > > log.Debug("A"); > > log.Debug("AB"); > > log.Debug("ABC"); > > log.Debug("ABCD"); > > > > Output: > > A > > AB > > ABC > > ABCD > > A - repeated 2 times > > AB - repeated 2 times > > ABC - repeated 2 times > > ABCD - repeated 2 times > > A - repeated 3 times > > AB - repeated 3 times > > ABC - repeated 3 times > > ABCD - repeated 3 times > > > > Or do you want to queue up repeated lines and output them when the > > repository shuts down? > > > > A - repeated 3 times > > AB - repeated 3 times > > ABC - repeated 3 times > > ABCD - repeated 3 times > > > > If you queue up repeated outputs not only will they potential take > up a > > lot of memory, but you'd loose all of the time stamp information > > associated with a logging event. > > > > - Ron > > >