Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 13703 invoked from network); 21 Jan 2010 18:46:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 21 Jan 2010 18:46:51 -0000 Received: (qmail 76422 invoked by uid 500); 21 Jan 2010 18:46:50 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 76360 invoked by uid 500); 21 Jan 2010 18:46:50 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 76349 invoked by uid 99); 21 Jan 2010 18:46:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2010 18:46:50 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [72.22.94.67] (HELO virtual.halosg.com) (72.22.94.67) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jan 2010 18:46:41 +0000 Received: (qmail 13420 invoked from network); 21 Jan 2010 12:46:20 -0600 Received: from unknown (HELO ?10.0.0.106?) (63.231.90.238) by halosg.com with (DHE-RSA-AES256-SHA encrypted) SMTP; 21 Jan 2010 12:46:19 -0600 Message-ID: <4B58A0FA.4010704@hanik.com> Date: Thu, 21 Jan 2010 11:46:18 -0700 From: Filip Hanik - Dev Lists User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: svn commit: r898745 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/juli/FileHandler.java webapps/docs/logging.xml References: <20100113132854.BC39223888E8@eris.apache.org> <4B4DE223.5030607@hanik.com> In-Reply-To: <4B4DE223.5030607@hanik.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org so even a bufferSize of 0 doesn't flush, and that is because the StreamEncoder has a non configurable buffering mechanism (instantiated through the OutputStreamWriter) and has nothing to do with buffering we implemented. setting -1 leads to direct flushing as expected. Filip On 01/13/2010 08:09 AM, Filip Hanik - Dev Lists wrote: > -1, I would propose this one to be > > writer.write(result); > if (bufferSize < 0) > flush(); > > > Here is why > > 1. No synchronized(this) - not sure why we think its needed > 2. It allows a setting of bufferSize==0 -> use system default > 3. bufferSize<0 do a flush of the writer > > best > Filip > > > On 01/13/2010 06:28 AM, jim@apache.org wrote: >> Author: jim >> Date: Wed Jan 13 13:28:54 2010 >> New Revision: 898745 >> >> URL: http://svn.apache.org/viewvc?rev=898745&view=rev >> Log: >> Merge r897380, r897381 from trunk: >> >> Followup for r816252/r891328 >> Allow to disable buffering in JULI FileHandler >> The previous implementation did not work as expected because of >> buffering performed by OutputStreamWriter >> >> Update documentation >> Submitted by: kkolinko >> Reviewed/backported by: jim >> >> Modified: >> tomcat/tc6.0.x/trunk/STATUS.txt >> tomcat/tc6.0.x/trunk/java/org/apache/juli/FileHandler.java >> tomcat/tc6.0.x/trunk/webapps/docs/logging.xml >> >> Modified: tomcat/tc6.0.x/trunk/STATUS.txt >> URL: >> http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=898745&r1=898744&r2=898745&view=diff >> >> ============================================================================== >> >> --- tomcat/tc6.0.x/trunk/STATUS.txt (original) >> +++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jan 13 13:28:54 2010 >> @@ -28,13 +28,6 @@ >> PATCHES ACCEPTED TO BACKPORT: >> [ start all new proposals below, under PATCHES PROPOSED. ] >> >> -* Allow to disable buffering in JULI FileHandler >> - It is followup to r891328, >> - which failed to implement this fix properly. >> - http://svn.apache.org/viewvc?rev=897380&view=rev (fix) >> - http://svn.apache.org/viewvc?rev=897381&view=rev (Documentation) >> - +1: kkolinko, markt, rjung, jim >> - -1: >> >> PATCHES PROPOSED TO BACKPORT: >> [ New proposals should be added at the end of the list ] >> >> Modified: tomcat/tc6.0.x/trunk/java/org/apache/juli/FileHandler.java >> URL: >> http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/juli/FileHandler.java?rev=898745&r1=898744&r2=898745&view=diff >> >> ============================================================================== >> >> --- tomcat/tc6.0.x/trunk/java/org/apache/juli/FileHandler.java >> (original) >> +++ tomcat/tc6.0.x/trunk/java/org/apache/juli/FileHandler.java Wed >> Jan 13 13:28:54 2010 >> @@ -144,7 +144,16 @@ >> try { >> PrintWriter writer = this.writer; >> if (writer!=null) { >> - writer.write(result); >> + if (bufferSize> 0) { >> + writer.write(result); >> + } else { >> + synchronized (this) { >> + // OutputStreamWriter performs buffering >> inside its StreamEncoder, >> + // and so to run without a buffer we have to >> flush explicitly >> + writer.write(result); >> + writer.flush(); >> + } >> + } >> } else { >> reportError("FileHandler is closed or not yet >> initialized, unable to log ["+result+"]", null, >> ErrorManager.WRITE_FAILURE); >> } >> >> Modified: tomcat/tc6.0.x/trunk/webapps/docs/logging.xml >> URL: >> http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/logging.xml?rev=898745&r1=898744&r2=898745&view=diff >> >> ============================================================================== >> >> --- tomcat/tc6.0.x/trunk/webapps/docs/logging.xml (original) >> +++ tomcat/tc6.0.x/trunk/webapps/docs/logging.xml Wed Jan 13 13:28:54 >> 2010 >> @@ -129,9 +129,10 @@ >>
  • The root logger can define its set of handlers using a >> .handlers property.
  • >>
  • Logging is buffered using a default buffer size of 8192 bytes. >> - To change buffersize, use thebufferSize >> property.
  • >> -
  • System property replacement for property values which start with >> - ${systemPropertyName}.
  • >> + To change buffersize, use thebufferSize property >> of a handler. >> + The value of0 disables buffering. >> +
  • System property replacement is performed for property values which >> + contain ${systemPropertyName}.
  • >> >>

    >>

    >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: dev-help@tomcat.apache.org >> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org > For additional commands, e-mail: dev-help@tomcat.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org