The L4FileAppender class does not support the usage of ~ in the path name. This makes it very complicated to place files into the standard directory ~/Library/Logs.
This could be fixed by changing line 86 from
if (![fileManager createFileAtPath: fileName contents: nil attributes: nil]) {
to
if (![fileManager createFileAtPath: [fileName stringByExpandingTildeInPath] contents: nil attributes: nil]) {
The change proposed in the details is not complete. The following change would fix the problem
NSString *expandedFileName = [fileName stringByExpandingTildeInPath];
if (![fileManager fileExistsAtPath: expandedfileName]) {
// if the we cannot create the file, raise a FileNotFoundException
// if (![fileManager createFileAtPath: fileName contents: nil attributes: nil]) {
if (![fileManager createFileAtPath: expandedFileName contents: nil attributes: nil]) {
[NSException raise: @"FileNotFoundException" format: @"Couldn't create a file at %@", expandedFileName];
}
}
// if we had a previous file name, close it and release the file handle
if (fileName != nil) {
[self closeFile];
}
// open a file handle to the file
// [self setFileHandle: [NSFileHandle fileHandleForWritingAtPath: fileName]];
[self setFileHandle: [NSFileHandle fileHandleForWritingAtPath: expandedFileName]];