At 11:42 AM 11/1/2005 -0500, you wrote:
>I m using some code to create dir if it does not exist, in my own appender
> If someone can put it in setFile() in log4j code, it would be great!

I believe this is now done in Log4j-1.3, but I'm not 100% sure about that. I recall there was a discussion about it on the dev list, but I'm not positive it ended up with the actual change being made to code.

Jake

> ks
> public void createDirs(String fileName) {
>try {
>File f = new File(fileName);
>String dir = f.getCanonicalPath();
>System.out.println("log4j log is here "+dir);
>int lastSlash = 0;
>if (dir != null) {
>lastSlash = dir.lastIndexOf(File.separator);
>if (lastSlash != -1) {
>dir = dir.substring(0, lastSlash);
>File directory = new File(dir);
>directory.mkdirs();//vow
>}
>}
>throw new Exception("To find where I am !! ");
>} catch (Exception e) {
>e.printStackTrace();//ignore
>}
>}


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

Reply via email to