2012/12/3 Rainer Jung <rainer.j...@kippdata.de>:
> On 03.12.2012 12:09, Konstantin Kolinko wrote:
>> 2012/11/29  <rj...@apache.org>:
>>> 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to