In my application, i have logged the details of the application in project.log with the help of following code.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"project.log"];
freopen([logPath fileSystemRepresentation],"a+",stderr);
This code will perfectly log all the details that i defined in nslog. Now i don't want my log file to grow much further. So i want to clear the content of log files that was logged before 1 week or more. But i need the content of log for last 7 days. Is there any possible solution to accomplish the above?