Howdy,
I'm not a big fan of this ;)  You can get DailyRollingFileAppender to put the file in 
a directory by simply specifying the directory as part of the log file name.  Then the 
log file and all its rolled over versions stay in that directory.

But whether I'm a fan or not doesn't matter as much as the fact this class is not in 
the spirit of our new rolling/triggering policies.  We've spent a lot of time making 
these more flexible for log4j 1.3, and you can see the relevant code at 
http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4j/rolling/.

Nonetheless, thanks for contributing,

Yoav Shapira
Millennium Research Informatics

-----Original Message-----
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 10:22 AM
To: '[EMAIL PROTECTED]'
Subject: RE: DateFormatFileAppender

1. Sending to correct list now.  Sorry.
2. DateFormatFileAppender is different than DailyRollingFileAppender as far as I can 
tell.  I couldn't get DailyRollingFileAppender to put the file in a subdirectory based 
on the date.  Looking at the code it doesn't look like subdirectories in the pattern 
are supported.  The other difference is that DailyRollingFileAppender has the current 
logs always in the same file (the old logs are named based on date).  
DateFormatFileAppender names the current file based on the date.
   Sample File: 'logs/'yyyy/MM-MMM/dd-EEE/HH-mm-ss-S'.log'
   Makes a file like: logs/2004/04-Apr/13-Tue/09-45-15-937.log
I have also changed the code so that it takes an option "Separate" so that each log is 
in a separate file (and the File option is re-evaluated each time).  This is useful 
when logging errors with stack traces.  I can provide more information if anyone 
thinks that might be good to add to log4j.  Either way it is working well for us so 
far.  I attached the current code but it is in a package from our code right now (easy 
to change).
James Stauffer
(Thanks for the great product!)
-----Original Message-----
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 7:55 AM
To: Log4J Developers List
Subject: RE: DateFormatFileAppender

Hi,
1. This already exists (DailyRollingFileAppender in log4j 1.2 and various options in 
log4j 1.3),
2. This is the wrong list: log4j-user is the place.
Yoav Shapira
Millennium Research Informatics
-----Original Message-----
From: James Stauffer [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 13, 2004 11:25 AM
To: '[EMAIL PROTECTED]'
Subject: DateFormatFileAppender
I posted a message to the user list titled "Logs separated by year/mon/day."  It 
doesn't look like any current appenders support what I am trying to do so I wrote a 
new appender (attached).  It works but probably needs to be cleaned up (formatting, 
etc) to fit in log4j.  (The only change I made after my last run with it was to change 
the package.)  I also don't know if I did things the "preferred" way.  It is a simple 
class.  It just overrides setFile(String, boolean, bufferedIO, bufferSize) to format 
the given fileName and produce another fileName (producing directories as necessary).  
Is this something that you would be interested in having in log4j?  If yes, I can 
clean it up more and follow any advice you have.  I tried bugzilla but it appears to 
be down right now.  Questions and comments are welcome.
 
James Stauffer
 

This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.

--------------------------------------------------------------------- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to