If cocoa app crashes where is stacktrace /crash log stored?

cocoa, macos

Solution

Crash logs can be found in a number of places.

In MacOS 10.8 (and I believe also 10.7) crash logs would be "`~/Library/Logs/DiagnosticReports`" or "`/Library/Logs/DiagnosticReports`" (the first is for crashes for user apps and the second is for system-wide apps).

Now instead of "reinventing the wheel", you may want to consider third party alternatives that can generate and return crash reports to you. Wikipedia lists these:

- Unsanity developed an Input Manager called Smart Crash Reports, that patches Apple software to include a "submit to developer" button within Crash Reporter. Smart Crash Reports only works with Mac OS X 10.4 and 10.5.

- Uli Kusterer wrote UKCrashReporter, which can send the output of Apple's Crash Reporter to a developer the next time the application is started.

- CMCrashReporter is a small opensource framework, which can send the crashlog to the developer (via HTTP POST) and let the user enter optional details.

- ILCrashReporter-NG, a fork of Infinite Loop's ILCrashReporter (which was for Mac OS X 10.2-10.5); current OS support unknown

- plcrashreporter Plausible CrashReporter provides an in-process crash reporting framework for use on both the iPhone and Mac OS X

- Google Breakpad, an open-source multi-platform crash reporting system

Problem

I am new to mac and cocoa development. When a cocoa app crashes there is a windows that asks the user to report crash log to apple. I want to write a customized reporting component. So I want to know if crash reports /log are automatically stored somewhere are these simple text files or core dumps ? I am looking to support 10.5 to 10.8

Original source