Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-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 ECFC6D419 for ; Mon, 3 Dec 2012 11:59:08 +0000 (UTC) Received: (qmail 98234 invoked by uid 500); 3 Dec 2012 11:59:08 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 98022 invoked by uid 500); 3 Dec 2012 11:59:08 -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 98000 invoked by uid 99); 3 Dec 2012 11:59:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 11:59:07 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rainer.jung@kippdata.de designates 195.227.30.149 as permitted sender) Received: from [195.227.30.149] (HELO mailserver.kippdata.de) (195.227.30.149) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 11:58:57 +0000 Received: from [195.227.30.209] (notebook-rj [195.227.30.209]) by mailserver.kippdata.de (8.13.5/8.13.5) with ESMTP id qB3BwbPf006590 for ; Mon, 3 Dec 2012 12:58:37 +0100 (CET) Message-ID: <50BC93EB.5090909@kippdata.de> Date: Mon, 03 Dec 2012 12:58:35 +0100 From: Rainer Jung User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: dev@tomcat.apache.org Subject: Re: svn commit: r1415081 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/valves/ webapps/docs/ webapps/docs/config/ References: <20121129083352.4008823889E2@eris.apache.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org On 03.12.2012 12:09, Konstantin Kolinko wrote: > 2012/11/29 : >> Author: rjung >> Date: Thu Nov 29 08:33:47 2012 >> New Revision: 1415081 >> >> URL: http://svn.apache.org/viewvc?rev=1415081&view=rev >> Log: >> Add new ALV attribute "renameOnRotate" (Default:false). >> >> If set to "true", the "fileDateFormat" will not be part >> of the current log file. Only at the time of log rotation >> the file is renamed to the final name including the >> "fileDateFormat". >> >> This mimics the behavior e.g. of Log4J and similar frameworks, >> where the active file does not have the timestamp in the file >> name. >> >> Pro: current file has stable name, all files with >> timestamp in name are old. >> Con: Slightly more complex impl. >> >> Backport of r1414889 from trunk. >> >> Modified: >> tomcat/tc7.0.x/trunk/ (props changed) >> tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/AccessLogValve.java >> tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/LocalStrings.properties >> tomcat/tc7.0.x/trunk/java/org/apache/catalina/valves/mbeans-descriptors.xml >> tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml >> tomcat/tc7.0.x/trunk/webapps/docs/config/valve.xml >> > > Interesting. > Several notes. Just informational. Thanks for testing! > a) It should be easy to extend this to skip rotation if file.length() is 0. > > b) The sample configuration in conf/server.xml is > prefix="localhost_access_log." suffix=".txt" > If I just enable this feature, I would get a file named > "localhost_access_log..txt" with two dots. > > A remedy is to explicitly define the fileDateFormat attribute and move > the dot from prefix attribute into fileDateFormat one. Yes, what about moving the trailing prefix dot to fileDateFormat for TC 8 and making the default fileDateFormat explicitly known by adding it to the default server.xml? If we do so: should we still automatically set a default fileDateFormat if the config contains an explicit empty one? I'd say no (all for TC 8). I'm reluctant about changing the default for TC 7 in case someone only changed prefix or suffix or fileDateFormat and then will suddenly observe different behavior. I think it is better to let the few people using the feature fix their settings if they turn on renameOnRotate and observe the double dot. For the sake of completeness: the code and config defaults currently differ slightly (TC 7 and 8): Config: prefix="localhost_access_log." suffix=".txt" fileDateFormat= Code Default Code: prefix="access_log."; suffix=""; fileDateFormat="yyyy-MM-dd" I would then move the trailing prefix dot in front of the fileDateFormat default. Regards, Rainer --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org