Wouldn't you just need to subclass FileAppender class, override the setFile() method and have the code call File.mkdirs() and then call the superclass version?
-Mark > -----Original Message----- > From: Rajan Annadurai [mailto:[EMAIL PROTECTED]] > Sent: Saturday, June 01, 2002 6:02 PM > To: Log4J Users List > Subject: extended FileAppenders to create the file directory > > > Has anybody extended FileAppenders to create the file directory if it > does not exist? > > Help would be appreciated. > > Thanx, > Rajan > > -----Original Message----- > From: Thomas Tuft Muller [mailto:[EMAIL PROTECTED]] > Sent: Thursday, May 30, 2002 2:14 PM > To: Log4J Users List > Subject: RE: java.io.FileNotFoundException: /LOG/temp.log (The system > cannot find the path specified) > > You have to code it yourself. > > -- > > Thomas > > | -----Original Message----- > | From: Rajan Annadurai [mailto:[EMAIL PROTECTED]] > | Sent: 30 May 2002 19:08 > | To: [EMAIL PROTECTED] > | Subject: java.io.FileNotFoundException: /LOG/temp.log (The system > cannot > | find the path specified) > | > | > | Hi , > | > | > | > | RollingFileAppender peAppender = new > | RollingFileAppender(defaultPattern,"/LOG/temp.log",true); > | > | > | > | The above line throws java.io.FileNotFoundException if the directory > is > | not present. How do you make log4j create the directory if it is not > | present? > | > | > | > | Thanx, > | > | Rajan > | > | > > > ************************************************************** > ********** > * > Copyright ERA Technology Ltd. 2002. (www.era.co.uk). All rights > reserved. > The information supplied in this email should be treated in > confidence. > No liability whatsoever is accepted for any loss or damage > suffered as a result of accessing this message or any attachments. > > ______________________________________________________________ > __________ > This email has been scanned for all viruses by the MessageLabs SkyScan > service. For more information on a proactive anti-virus > service working > around the clock, around the globe, visit http://www.messagelabs.com > ______________________________________________________________ > __________ > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
