iOS13 + CFNetwork Diagnostic Logging

I set the XCode environment variable CFNETWORK_DIAGNOSTICS to 3,


according to https://developer.apple.com/documentation/network/debugging_https_problems_with_cfnetwork_diagnostic_logging


and then running the app, I don't see any logs in Xcode debug console.


Then, I try to put the code

setenv("CFNETWORK_DIAGNOSTICS", "3", 1);

at the start of my main function, and then running the app, I still don't see any logs in Xcode debug console.


When I switch the simulator to iOS 12, Xcode debug console output many logs likes: "CFNetwork Diagnostics ....".


My Xcode version is Version 11.3.1 (11C504).


Is it CFNetwork Diagnostic still available in iOS13?

I don't see any logs in Xcode debug console.

Indeed. The mechanism used by CFNetwork diagnostic logging has changed under the covers, meaning that log entries no longer show up in the Xcode console. However, CFNetwork diagnostic logging still works. Use the Console app, as described in the View Log Entries section of that article.

Oh, and if you paste the following lines into Console’s search box, one at a time, it’ll set up a filter that shows just these log entries:

subsystem:com.apple.CFNetwork
category:Diagnostics

You can then click the Save button to save that search.

Finally, please file a bug against the doc asking that it be updated to cover this recent development.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

the article still suggests it does

sixmiles didn’t post a bug number, so I’m not sure if one ever got filed about that )-:

Taking a step back, what’s your goal here? If you just want to monitor HTTP traffic, I strongly recommend that you move over to the new network instrument support. It’s awesome! For the details, see WWDC 2021 Session 10212 Analyze HTTP traffic in Instruments.

If you trying to understand something about the internals of CFNetwork, its diagnostic logging feature is still relevant. If that’s the case, post back here and I’ll do a little digging.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

iOS13 + CFNetwork Diagnostic Logging
 
 
Q