Permalink
Browse files

Change iOS logging directory to use cache directory instead of docume…

…nts directory

This way the log files will not be part of the iCloud backup
  • Loading branch information...
1 parent 228cdf7 commit 3bf4585593851015a8ad00d155fe295d7fcd5fe6 @TheRealKerni committed Feb 5, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 Lumberjack/DDFileLogger.h
  2. +1 −1 Lumberjack/DDFileLogger.m
@@ -97,7 +97,7 @@
// All log files are placed inside the logsDirectory.
// If a specific logsDirectory isn't specified, the default directory is used.
// On Mac, this is in ~/Library/Application Support/<Application Name>/Logs.
-// On iPhone, this is in ~/Documents/Logs.
+// On iPhone, this is in ~/Library/Caches/Logs.
//
// Log files are named "log-<uuid>.txt",
// where uuid is a 6 character hexadecimal consisting of the set [0123456789ABCDEF].
@@ -180,7 +180,7 @@ - (void)deleteOldLogFiles
- (NSString *)defaultLogsDirectory
{
#if TARGET_OS_IPHONE
- NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *baseDir = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSString *logsDirectory = [baseDir stringByAppendingPathComponent:@"Logs"];

0 comments on commit 3bf4585

Please sign in to comment.