Hi all,

  I'd like to bring the following thread to your attention.

http://www.mail-archive.com/log4j-dev@jakarta.apache.org/msg00532.html

  I'm currently subclassing FileAppender and overriding setFile() (as
mentioned in the thread) to automatically create the directories implied by
FileAppender.fileName if they do not already exist.  It would be helpful if
this functionality were available in FileAppender.  This could be
implemented with a property that could be on or off by default, such as
createDirs.  Setting createDirs to true would then cause the FileAppender to
write any directories that are needed to write the log file.

  As to whether this is a proper function to provide to the user, I propose
that if the file is created if it does not exist, then the directories
should similarly be created if they also do not exist.  Why should there be
a distinction between the path to the file and the file itself?  It seems to
me that this (arbitrary?) distinction is an artifact of the native
implementation of FileOutputStream.openAppend(), which, it seems to me,
could easily have been implemented to write the directories also, if needed.

  I am interested in hearing any counter-arguments.  Thanks for taking a
look at this.  BTW, I'd be happy to implement the change and submit it via
email if there aren't any objections.

  - Matt



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

Reply via email to