title: How to store crash log file inside the ios application?
body: <p>suppose my application was crashed means at that time <code>applicationWillTerminate</code> function is called. In that function i want to save the crash log file in the Temporary directory.
  when app is launch at that time I want to upload the crash report file from the iOS device to my server location  thorough the coding.</p>
  
  <p>I'm using this code to save the crash log file.</p>
  
  <pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0];
  NSString *logPath = [documentsDirectory stringByAppendingPathComponent:@"console.log"];
  freopen([logPath cStringUsingEncoding:NSASCIIStringEncoding],"a+",stderr);
  </code></pre>
  
  <p>but this code will work in the simulator. i can able to see this file in </p>
  
  <pre><code>/Users/UserNAme/Library/Application Support/iPhone Simulator/6.0/Applications/xxx-yyy-sss--eee/Documents/console.log
  </code></pre>
  
  <p>but i can't find this file in the ios devices. </p>
  
  <p>Note:
  for finding file in the ios device I'm using <code>iExplorer</code> </p>