Return-Path: X-Original-To: apmail-logging-log4net-dev-archive@www.apache.org Delivered-To: apmail-logging-log4net-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B389072E5 for ; Tue, 6 Sep 2011 09:58:40 +0000 (UTC) Received: (qmail 35701 invoked by uid 500); 6 Sep 2011 09:58:40 -0000 Delivered-To: apmail-logging-log4net-dev-archive@logging.apache.org Received: (qmail 35438 invoked by uid 500); 6 Sep 2011 09:58:34 -0000 Mailing-List: contact log4net-dev-help@logging.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Log4NET Dev" List-Id: Delivered-To: mailing list log4net-dev@logging.apache.org Received: (qmail 35423 invoked by uid 99); 6 Sep 2011 09:58:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 09:58:31 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 09:58:29 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id BF14082A51 for ; Tue, 6 Sep 2011 09:58:09 +0000 (UTC) Date: Tue, 6 Sep 2011 09:58:09 +0000 (UTC) From: "Stefan Bodewig (JIRA)" To: log4net-dev@logging.apache.org Message-ID: <130324168.19763.1315303089761.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (LOG4NET-239) LoggingEvent m_cacheUpdatable is useless and even produce an unexpected behavior MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4NET-239?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:all-tabpanel ] Stefan Bodewig updated LOG4NET-239: ----------------------------------- Fix Version/s: 1.2 Maintenance Release > LoggingEvent m_cacheUpdatable is useless and even produce an unexpected b= ehavior > -------------------------------------------------------------------------= ------- > > Key: LOG4NET-239 > URL: https://issues.apache.org/jira/browse/LOG4NET-239 > Project: Log4net > Issue Type: Bug > Affects Versions: 1.2.10 > Environment: .Net 2.0 > Reporter: Fran=C3=A7ois Dumont > Fix For: 1.2 Maintenance Release > > > I already notify my problem on the mailing but as I had no answer I final= ly prefered to report it here. Rather than copy/paste my mail I prefered to= write a test that has to be added to the BufferingAppenderTest: > [Test, Description("Check that use of the BufferingAppender shall= not change the rendering of the log event.")] > public void TestAppenderSkeletonBehavior() > { > SetupRepository(); > ObserverAppender observer =3D new ObserverAppender(); > m_bufferingForwardingAppender.AddAppender(observer); > ILogger logger =3D m_hierarchy.GetLogger("test"); > logger.Log(typeof(BufferingAppenderTest), Level.Warn, "Messag= e", new Exception("Exception")); > Assert.AreEqual(1, observer.EventsCount); > LoggingEvent loggingEvent1 =3D observer.Dequeue(); > // Lets see what happen if we do not fix the exception part o= f the logging event at the > // buffering forwarding appender level and let underlying app= enders deal with it: > m_bufferingForwardingAppender.Fix ^=3D FixFlags.Exception; > logger.Log(typeof(BufferingAppenderTest), Level.Warn, "Messag= e", new Exception("Exception")); > Assert.AreEqual(1, observer.EventsCount); > LoggingEvent loggingEvent2 =3D observer.Dequeue(); > // The two logging events shall be similar: > Assert.AreEqual(loggingEvent1.Level, loggingEvent2.Level); > Assert.AreEqual(loggingEvent1.Domain, loggingEvent2.Domain); > // Lets check the appender skeleton behavior: it normally ren= ders the exception string info > // if the layout do not do so invoking the GetExceptionString= method. > Assert.IsNotNull(loggingEvent1.GetExceptionString(), > "Missing exception information when bufferin= g appender fix it !"); > Assert.IsNotNull(loggingEvent2.GetExceptionString(), > "Missing exception information when buffering= appender do not fix it !"); > } > This test needs this following small appender implementation to work: > internal sealed class ObserverAppender : AppenderSkeleton > { > private readonly Queue loggingEvents; > public int EventsCount > { > get { return this.loggingEvents.Count; } > } > public ObserverAppender() > { > this.loggingEvents =3D new Queue(); > } > protected override void Append(LoggingEvent loggingEvent) > { > this.loggingEvents.Enqueue(loggingEvent); > } > public LoggingEvent Dequeue() > { > return this.loggingEvents.Dequeue(); > } > } > For info I try to comment m_cacheUpdatable =3D false and notice no regres= sion when running tests. I would really be interested in knowing what this = flag is for ? > Thanks -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira