I\'m creating logs using Apple\'s os.log
framework. I\'m just making logs like:
os_log(\"Update: Lat: %{public}f | Long: %{private}f | Remaini
After following the suggestions of this answer I was able to redirect the logs into the documents directory for my app's sandbox, then I was able to download my container/sandbox using this answer.
Once I clicked on show package contents I had this:
I opened the log files using console and the results I got were:
The Longitude should have showed up as private
but since I had it ran through Xcode ie debug mode still the field was rendered public.
system_logs.logarchive
with Console.appNote: Searching and filtering is quite slow. Sometimes it takes 2 minutes. It might help if you filter out the dates you don't care about. You can do that by using the filer at the bottom. You have to wait until the loading archive spinner at the bottom right is done loading
You did not specify iOS, macOS, or tvOS in your question, so I am keeping my answer generic across all platforms.
Review WWDC 2016 - Session 721 - Unified Logging and Activity Tracing.
Logging data is stored in a new compressed binary format (.tracev3
or .logarchive
files), that's what those "numbers" are. You must use Console.app or the log
command line tool to open these files.
You're looking in the wrong place for the log files. From the session video:
Those files are now stored under /var/db/diagnostics with additional supporting files in /var/db/uuidtext. There are new tools to access that data, there's a new Console, a new log command line tool and one of the things you have to keep in mind is because the data is now stored in a binary format you must use the new tools to access it. So you can no longer grep through logs you have to use our tools to do the surfing through it.
There's also another new type of file the .logarchive, which is there for portability of log data. Essentially a .logarchive is a collection of information out of /var/db/diagnostics and you uuidtext collected together into a single file that's easier to transfer to email, to attach to bug reports and the like.
If you redirect stdout or stderr to a file (such as the code in this example), it should be in the Documents directory of your application's sandbox (or whatever directory you specified). Logs written to /var/db/diagnostics are generally unavailable to end users on iOS and tvOS.