Unified Logging: App’s Info / Debug Messages Never Show Up In Logarchive File

Originator:huapapojt
Number:rdar://35070435 Date Originated:10/18/2017
Status:Open Resolved:-
Product:Xcode, Console Product Version:9 (9A235)
Classification:Serious Bug Reproducible:Always
 
I have a more detailed post on [StackOverflow](https://stackoverflow.com/questions/46826381/unified-logging-app-s-info-debug-messages-never-show-up-in-logarchive-file).

Summary:
When deploying an app to my iOS device, triggering log collection via _sysdiagnose_, then exploring log messages in `system_logs.logarchive` obtained from iTunes sync, my app has never shown Info / Debug log messages type.

I am using [Paper Company (Swift)](https://developer.apple.com/library/content/samplecode/Logging/Introduction/Intro.html#//apple_ref/doc/uid/TP40017510-Intro-DontLinkElementID_2) to illustrate my problem. I start to deploy the app to my iOS device running iOS 11.0.3 as-is. The scheme is using Debug Mode. In my case:

- I always have “Include Info Messages” and “Include Debug Messages” on in Console.
- When I **live stream** my log messages while my app is running tethered to Xcode, I continue to **see all log messages including Info and Debug types on Console**.
- When I trigger **log collection via _sysdiagnose_** and read through `logarchive` file with Console, however, I **never see my app’s Info and Debug messages**. Other messages types, Default, Error, and Fault, continue to show up like when I live stream.
	- However, I **can still see Info and Debug messages that belong to other system processes**, but not my app’s process.

Please see accompanying screenshots. I also attached the sysdiagnose.

Because of such puzzling behavior, I started to think that it might have to do with system’s configuration. In [Logging documentation](https://developer.apple.com/documentation/os/logging):

> Info-level messages are initially stored in memory buffers. Without a configuration change, they are not moved to the data store and are purged as memory buffers fill. **They are, however, captured in the data store when faults and, optionally, errors occur.** When info-level messages are added to the data store, they remain there until a storage quota is exceeded, at which point, the oldest messages are purged. Use this level to capture information that may be helpful, but isn’t essential, for troubleshooting errors.

After reading that, I have also tried to change the Error type to Fault type, just for the sake of verifying that Info type messages will show up.

```
os_log("B-b-b-b-b-b-b-bomb 💣!", log: ViewController.ui_log, type: .fault)	// previously .error
```

However, I still don’t see any Info log messages in `logarchive` file.

Please note that Paper Company (Swift) already uses the `ASSETCATALOG_COMPRESSION` Build Settings. See [Read logs using the new swift os_log api
](https://stackoverflow.com/questions/40272910/read-logs-using-the-new-swift-os-log-api)

Steps to Reproduce:
1. Download and Open Paper Company (Swift) app
2. Build and deploy as-is on an iOS 11.0.3 device. I use iPad Pro 2nd Gen.
3. Open Console to Live Stream logs.
4. Tap trees, logs, papers buttons a few times, then tap the bomb.
5. Trigger sysdiagnose.

Expected Results:
Please see Summary above.

Actual Results:
Please see Summary above.

Version/Build:
Xcode 9 (9A235)

Configuration:
macOS 10.13, iOS 11.0.3. Please see screenshot for my MBP info.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!