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).
>
> 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.
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.

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