Hi,
My sandboxed application writes error.log without crashing completely.
Where should I write these error logs, and how is it possible to get them in order to improve my app.
Thanks in advance,
Regards,
Maarten,
Hi,
My sandboxed application writes error.log without crashing completely.
Where should I write these error logs, and how is it possible to get them in order to improve my app.
Thanks in advance,
Regards,
Maarten,
I’m not sure I understand your question but I’ll take a stab at the basics. There are two different strategies you can use here:
Apple System Log (ASL) — See the asl man page for details.
custom logging
If you’re using ASL, it takes care of where the logs get written, so you don’t have to worry about that.
If you use your own custom logging, you can put the log file anywhere within your app’s container, although
Library/Logs/ is traditional.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Yes, maybe the question was not so clear.
The error.log my app creates contains the complete stack trace of the problem (bug) in question but they are not created by or formatted according to Xcode. My application will continue to operate normally in almost all occasions so the OS will not get any notice that something went wrong.
Now that I cannot send the log to my servers when my app is sandboxed, I would really appreciate if I can get them through iTunes connect (if end users accepted to do so of course).
Now if writing them in Library/Logs/ or Library/Application Support/CrashReporter will give me the possibility to get my hands on my error.log through itunes-connect or any other way; so I can use them to improve my app that would be absolutely perfect.
Hope this makes it more clear.
Best Regards,
Maarten,
Thanks for the clarification.
To answer your direct question, no, there’s no supported way that you can convince the crash reporter / iTunes Connect infrastructure to handle arbitrary error log files; it’s only supported use is crash reports.
Now, you could make your app crash when it gets an error, but that’s probably not what you’re looking for.
Alternatively you could build your own error log transport mechanism. Yes, that means you’ll need to ask for the ‘outgoing network connections’ entitlement, but there’s nowt wrong with that as long as you have a good reason.
One thing you will have to be very careful about is user privacy. While I’m not qualified to advise you on how to resolve the potential privacy issues here, it’s clear that such issues exist.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"