Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 48730 invoked from network); 13 Nov 2007 05:35:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2007 05:35:56 -0000 Received: (qmail 27164 invoked by uid 500); 13 Nov 2007 05:35:43 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 27044 invoked by uid 500); 13 Nov 2007 05:35:43 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 27027 invoked by uid 99); 13 Nov 2007 05:35:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Nov 2007 21:35:43 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of james.mao@iona.com designates 12.170.54.180 as permitted sender) Received: from [12.170.54.180] (HELO amer-mx1.iona.com) (12.170.54.180) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Nov 2007 05:36:34 +0000 X-IronPort-AV: E=Sophos;i="4.21,408,1188792000"; d="scan'208";a="7161641" Received: from amer-ems1.ionaglobal.com ([10.65.6.25]) by amer-mx1.iona.com with ESMTP; 13 Nov 2007 00:35:25 -0500 Received: from [10.129.9.187] ([10.129.9.187]) by amer-ems1.IONAGLOBAL.COM with Microsoft SMTPSVC(6.0.3790.1830); Tue, 13 Nov 2007 00:35:23 -0500 Message-ID: <47393797.50904@iona.com> Date: Tue, 13 Nov 2007 13:35:19 +0800 From: James Mao User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: cxf-dev@incubator.apache.org CC: cxf-commits@incubator.apache.org Subject: Re: svn commit: r594302 - in /incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor: LoggingInInterceptor.java LoggingOutInterceptor.java References: <20071112212457.C4A381A9832@eris.apache.org> In-Reply-To: <20071112212457.C4A381A9832@eris.apache.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 13 Nov 2007 05:35:24.0259 (UTC) FILETIME=[FD373B30:01C825B6] X-Virus-Checked: Checked by ClamAV on apache.org Hi Dan, This is my bad :( I just used this function in the test, forgot about the interceptor will be mostly called multiple times. What about register a callback method, and the interceptor call the callback method at the end of the handleMessage, and pass in the instance of LoggingMessage? does it make sense? Or we can put an Interceptor in the tests, and it's just for the tests purpose? Regards, James > Author: dkulp > Date: Mon Nov 12 13:24:56 2007 > New Revision: 594302 > > URL: http://svn.apache.org/viewvc?rev=594302&view=rev > Log: > Fix logging interceptors to not store EVERYTHING logged to them and also be thread safe. > > Modified: > incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java > incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java > > Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java?rev=594302&r1=594301&r2=594302&view=diff > ============================================================================== > --- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java (original) > +++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingInInterceptor.java Mon Nov 12 13:24:56 2007 > @@ -37,7 +37,6 @@ > public class LoggingInInterceptor extends AbstractPhaseInterceptor { > > private static final Logger LOG = LogUtils.getL7dLogger(LoggingInInterceptor.class); > - private final LoggingMessage buffer = new LoggingMessage("Inbound Message\n----------------------------"); > > private int limit = 100 * 1024; > private boolean enabled; > @@ -56,10 +55,6 @@ > this.enabled = b; > } > > - public LoggingMessage getBuffer() { > - return this.buffer; > - } > - > public void setLimit(int lim) { > limit = lim; > } > @@ -75,6 +70,9 @@ > } > > private void logging(Message message) throws Fault { > + final LoggingMessage buffer = new LoggingMessage("Inbound Message\n----------------------------"); > + > + > String encoding = (String)message.get(Message.ENCODING); > > if (encoding != null) { > > Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java > URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java?rev=594302&r1=594301&r2=594302&view=diff > ============================================================================== > --- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java (original) > +++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/LoggingOutInterceptor.java Mon Nov 12 13:24:56 2007 > @@ -37,7 +37,6 @@ > public class LoggingOutInterceptor extends AbstractPhaseInterceptor { > > private static final Logger LOG = LogUtils.getL7dLogger(LoggingOutInterceptor.class); > - private final LoggingMessage buffer = new LoggingMessage("Outbound Message\n---------------------------"); > > private int limit = 100 * 1024; > private boolean enabled; > @@ -64,10 +63,6 @@ > return limit; > } > > - public LoggingMessage getBuffer() { > - return this.buffer; > - } > - > public void handleMessage(Message message) throws Fault { > final OutputStream os = message.getContent(OutputStream.class); > if (os == null) { > @@ -89,6 +84,8 @@ > } > > public void onClose(CachedOutputStream cos) { > + final LoggingMessage buffer = new LoggingMessage("Outbound Message\n---------------------------"); > + > if (cos.getTempFile() == null) { > //buffer.append("Outbound Message:\n"); > if (cos.size() > limit) { > > >