I usually work with log4j and log4cplus and want to define the name of the logfiles and where it was stored. How can i do it ???
Another question :
Is it possible to store the logfiles into the .app package or is it netter to store it in an external folder ?
Thanks in advance.
To change path where log file is stored:
NSString* documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
DDLogFileManagerDefault* logFileManager = [[DDLogFileManagerDefault alloc] initWithLogsDirectory:documentsDirectory];
_myLogger = [[DDFileLogger alloc] initWithLogFileManager:logFileManager];
[DDLog addLogger:_myLogger];
This example will store the log file in your app's Documents directory which will be available to iTunes if you enable file sharing via iTunes.
@memmaker650 and @djschwartz this is the correct approach. Thanks @djschwartz
Most helpful comment
To change path where log file is stored:
This example will store the log file in your app's Documents directory which will be available to iTunes if you enable file sharing via iTunes.