DateFormatFileAppender doesn't require you to use sub-directories. You are correct that it doesn't support groupings of hours (watches). Both DateFormateFileAppender and DailyRollingFileAppender use SimpleDateFormat so they only work for the patterns in that class. I suspect that your request is unique enough that it won't be added to log4j. You could easily create your own appender that does that. Look at DateFormatFileAppender for a sample of how to write your own appender.
On 3/23/07, Andrew Marlow <[EMAIL PROTECTED]> wrote:
>> Here is an example of how a logger worked that I was using before I >> started using log4j. >> >> The logfile name was of the form <prefix>yyyymmdd-w.txt where w is a >> watch number. The day is divided into 6 watches of 4 hours each, i.e. >> 0000->0400, 0400->0800, 0800-1200, 1200->1600, 1600->2000 and >> 2000->2400. Each time a call is made to the logger it ensures that >> it 2000->is writing to the correct logfile for the current watch. I don't think DateFormatFileAppender will do the watch thing. If I set the pattern to 'logs'yyyyMMdd'.log' there will be just one logfile for the day. The comments in your source give a sample pattern that will create sub-directories for yyy, MM-MMM and dd-EEE. This is definately not what I want. IMO a smaller number of files and directories is perferable. But having only one file per day is not enough. So although I appreciate this contribution (and very fast too), I still think my enh rqst stands. -Andrew M. ******************************************************************************" The data and information (collectively called Information) herein is the sole property of ICAP. The Information is confidential, may be legally privileged and is intended solely for the use of the individual or entity to whom it is addressed. Unauthorised disclosure, copying or distribution of the Information is strictly prohibited and the recipient of the Information shall not redistribute the Information in any form to a third party. If you received this Information in error please tell us by reply (or telephone the sender) and delete all copies on your system. References in this Information to ICAP are references to ICAP plc, a company incorporated in England with registered number 3611426 whose registered office is 2 Broadgate, London, EC2M 7UR and where the context requires, includes its subsidiary and associated undertakings. As applicable, certain companies within the ICAP group are authorised and regulated by the Financial Services Authority. Any investment research sent from ICAP will provide an impartial and objective assessment of the securities, companies or other matters that are the subject of their research and our Conflicts of Interest Management Policy regarding investment research can be viewed by requesting a copy from your usual contact at ICAP. Please visit www.icap.com for further regulatory information including details regarding the European eCommerce Directive. *******************************************************************************" We have taken precautions to minimise the risk of transmitting software viruses, but we advise you to carry out your own virus checks on any attachment to this message. We cannot accept liability for any loss or damage caused by software viruses. " ******************************************************************************* --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- James Stauffer http://www.geocities.com/stauffer_james/ Are you good? Take the test at http://www.livingwaters.com/good/ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
