aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j - Is the log file to be present when the application started? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j - Is the log file to be present when the application started?" Watch "log4j - Is the log file to be present when the application started?" New topic
Author

log4j - Is the log file to be present when the application started?

Makesh Kumar Ramakrishnan
Ranch Hand

Joined: Jan 07, 2006
Posts: 88
The file path is mentioned in the log4j property file.

If the particular directory is not available, log4j is throwing FileNotFound Exception. So, Is there anyway log4j automatically creates the directory path when the mentioned path is not available?.

Thanks,

Makesh
[ July 16, 2008: Message edited by: Makesh Kumar Ramakrishnan ]

Makesh<br /> <br />SCJP | SCWCD | SCBCD | SCEA
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Well, as you can see, it doesn't. You could check the documentation for that appender but I doubt you will find any method to specify "Create the directory if it doesn't exist".

However it shouldn't take more than a couple of minutes to create the directory. I would just do that rather than hunting down the docs.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j - Is the log file to be present when the application started?