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 2366FE294 for ; Mon, 3 Dec 2012 12:46:01 +0000 (UTC) Received: (qmail 25292 invoked by uid 500); 3 Dec 2012 12:46:00 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 24849 invoked by uid 500); 3 Dec 2012 12:46:00 -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 24816 invoked by uid 99); 3 Dec 2012 12:45:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 12:45:59 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of knst.kolinko@gmail.com designates 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vb0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Dec 2012 12:45:54 +0000 Received: by mail-vb0-f45.google.com with SMTP id p1so2146334vbi.18 for ; Mon, 03 Dec 2012 04:45:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=kpbUivBGJHVe+UTpgxgpaH/Lwm66ualG0TzY6Vc5tUE=; b=WmxAAZOveXlL08VFaQhOeihRdP2dWQthHGzZHDXcPN1y73Nn50FBRkqN7fxMnXamHA XArYJrv2hx5cBSqq98yqapE3M236sUrgbPxQm7iiZJAH8QsVV9A8kAvotPhl5Po/2bBM a3D59dDvwmIdmThMi3/GDQNTxuZs+n1otUymEgzdBUbZrNGy3oCtf6QJzpqMI0rk94Ni OFEzDdUPhbFa2nLnP3WHpF4ppuV5hDEvbClYZKrPW16HE+RVXSXiC9bEQwB369cX+tZu paTXq+ohjgHnvDR/PjpTA/9fHYzRMXvHmUvtOF56XCtcG/P/tp8ikYpfsTXQ853RnnpU zSkA== MIME-Version: 1.0 Received: by 10.52.88.33 with SMTP id bd1mr7338893vdb.70.1354538733449; Mon, 03 Dec 2012 04:45:33 -0800 (PST) Received: by 10.58.249.199 with HTTP; Mon, 3 Dec 2012 04:45:33 -0800 (PST) In-Reply-To: <50BC93EB.5090909@kippdata.de> References: <20121129083352.4008823889E2@eris.apache.org> <50BC93EB.5090909@kippdata.de> Date: Mon, 3 Dec 2012 16:45:33 +0400 Message-ID: Subject: Re: svn commit: r1415081 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/valves/ webapps/docs/ webapps/docs/config/ From: Konstantin Kolinko To: Tomcat Developers List Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org 2012/12/3 Rainer Jung : > 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). >>> >> >> 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. > The programmatic defaults serve different purpose than those in server.xml. In server.xml we define the "global" access log (thus it is named as "localhost" one). In AccessLogValve there are defaults for any access log out there in the wild. I was only thinking of updating the server.xml one by explicitly defining fileDateFormat there. On second thought, a) It is pointless to change server.xml if we are not also adding renameOnRotate="true" there. It is of little value. b) I wonder whether there will be some problems on Windows when using this feature. (A file deletion does not happen immediately there. I wonder what is the case with renames). So I would keep the current default of renameOnRotate="false". Maybe just add a configuration example to valves.html. > >> a) It should be easy to extend this to skip rotation if file.length() is 0. > > Not so sure about that one. An empty rotated file shows there was > nothing written. Skipping rotation might lead to the question, whether > rotation is broken (or the server was down during the change of date). > > So I'd prefer keeping the rotation since it isn't so expensive and > doesn't happen to early. > Just a different feature that people ask sometime: do not create a log file if it is empty. An RFE for JULI: https://issues.apache.org/bugzilla/show_bug.cgi?id=53620 An example is those "host-manager." logs that are in the default configuration, but nearly nobody is using that app. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org