Hi all - I am new to log4j and the mailing list. I have a query and I would appreciate if anyone can post a reply.
My requirement is that I need to have my log file names as per the following format: file_MMDDYYYY_hh:mm:ss where "file_" is a fixed string, MM denotes month of the year, DD denotes the date of the month, YYYY denotes the year, "hh" denotes the hour of the day, "mm" denotes the minute of the hour and "ss" denotes the seconds. This seems to be simple to implement if I use the "DailyRollingFileAppender". The problem is that the file I write to should roll over ONLY at midnight. If I set the "DateFormat" to roll over at midnight, then I do not get the "hh:mm:ss" appended to the file. Furthermore, how do I use a colon in the filename above?? I have an additional requirement. In addition to having the file rolled over daily at midnight, I also need to specify a max file size for each file. I understand that the maximum file size can be implemented using the "RollingFileAppender". So, do I use the RollingFileAppender or the DailyRollingFileAppender and is there any way I can configure log4j to integrate the above two desired features? This is the reason(max file size) why we have the "hh:mm:ss" field in the filename, in addition to the date(although it rolls over only at midnight provided the max file size is not reached). Can anyone help? Thanks and regards, Rubal. -- To unsubscribe, e-mail: <mailto:log4j-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:log4j-user-help@;jakarta.apache.org>