You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2008/05/05 16:44:39 UTC

DO NOT REPLY [Bug 44934] New: add helper method to DailyRollingFileAppender to generate schedule file name

https://issues.apache.org/bugzilla/show_bug.cgi?id=44934

           Summary: add helper method to DailyRollingFileAppender to
                    generate schedule file name
           Product: Log4j
           Version: 1.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Appender
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: hmak@vaultus.com


Request to add helper method to DailyRollingFileAppender to generate schedule
file name.  That way, subclasses can determine the names of the files that the
appender will archive to.  i.e.,

Change Log4j v1.2.15 from

        void rollOver() throws IOException {
                ...
                String datedFilename = fileName+sdf.format(now);
                ...
        }

to

        void rollOver() throws IOException {
                ...
                String datedFilename = getScheduledFileName(now);
                ...
        }

        /**
         * Subclasses may override this to change the name
         * of file that logs get rotated to.
         *
         * @param date  [in] (non-null) time used to tag logs being rotated out
         *
         * @return name of file [to rotate to]
         */
        protected String getScheduledFileName(Date date) {
                return fileName + sdf.format(now);
        }


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44934] add helper method to DailyRollingFileAppender to generate schedule file name

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44934


Curt Arnold <ca...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|45527                       |




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 44934] add helper method to DailyRollingFileAppender to generate schedule file name

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44934


Thorbjørn Ravn Andersen <th...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |45527
             Status|NEW                         |NEEDINFO




--- Comment #1 from Thorbjørn Ravn Andersen <th...@gmail.com>  2008-08-02 15:52:14 PST ---
Would it be sufficient with a pattern (with an information set available on the
file to be rolled out) or do you want to be able to sub class?  I think there
should be a number of overrideable methods to subclass to make things easier.

We had a need for rolling logs, and being able to compress and rename those
which would otherwise have been deleted.  It was not easy to do nicely.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org