You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/01/23 20:50:17 UTC

DO NOT REPLY [Bug 16374] New: - Make access log filename date format configurable in AccessLogValve

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16374>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16374

Make access log filename date format configurable in AccessLogValve

           Summary: Make access log filename date format configurable in
                    AccessLogValve
           Product: Tomcat 4
           Version: 4.1.20
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: mheinrichs@rogers.com


The access log filename date format is currently hardcoded in
org.apache.catalina.valves.AccessLogValve.  I would like to be able to provide
my own date format in the valve descriptor in server.xml. e.g.,

<Valve className="org.apache.catalina.valves.AccessLogValve"
   directory="logs"  prefix="access_log."
   dateFormat="yyyy.MM.dd" suffix=""
   pattern="common" resolveHosts="false"/>

I am willing to provide the patch for this functionality, but I have a couple of
points on which I would like feedback.

1. In the current AccessLogValve implementation, the hardcoded date format is
used in the filename, and it is also used to detect whether the log should be
rotated (i.e., if the string produced by the date format changes, the log should
rotate).  If I simply make that date format configurable, the filename will
change, but the rotation interval could also change, depending on how often the
resulting date string changes.  Responses on the tomcat-dev list suggest that
these two concerns should be separate.  Is there any disagreement?

2. If the provided date format is invalid, the creation of the SimpleDateFormat
throws IllegalArgumentException, which is a RuntimeException.  If the exception
is uncaught, Tomcat startup fails, and the exception is not logged. 
IllegalArgumentException should be caught, and a new DateFormatException thrown.
 This new Exception class will also have to be created.

3. If the provided date format does not result in a string which changes on a
daily basis, when the log rotates (daily), the new filename will be the same as
the old filename, simply over-writing the previous day's log.  In this case,
this is probably the correct behavior.  Note that if the provided date format
controls both the filename and the rotation (see point 1), this problem goes away.

Comments?

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>