You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2012/07/11 14:04:38 UTC
[Bug 53536] RollingFileAppender with TimeBasedRolling policy doesn't
create parent-path if FileNamePattern contains date pattern as directory
https://issues.apache.org/bugzilla/show_bug.cgi?id=53536
Daniel Stankiewicz <da...@asseco.pl> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from Daniel Stankiewicz <da...@asseco.pl> ---
org.apache.log4j.FileAppender contains the following code for creating
FileOutputStream, which should be incorporated also to
org.apache.log4j.rolling.RollingFileAppender:
FileOutputStream ostream = null;
try {
//
// attempt to create file
//
ostream = new FileOutputStream(fileName, append);
} catch(FileNotFoundException ex) {
//
// if parent directory does not exist then
// attempt to create it and try to create file
// see bug 9150
//
String parentName = new File(fileName).getParent();
if (parentName != null) {
File parentDir = new File(parentName);
if(!parentDir.exists() && parentDir.mkdirs()) {
ostream = new FileOutputStream(fileName, append);
} else {
throw ex;
}
} else {
throw ex;
}
}
--
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org