Unable to see *any* debug statements from the FileProviderExtension spawned from Finder

I am in the process of writing a macOS app using NSFileProviderExtension so that I can map my customer's data in Finder. I am in the process of building it out, I had initially started in Obj-C and then after the advice of folks here (https://developer.apple.com/forums//thread/793272?answerId=849339022&page=1#849752022) I have switched to Swift as the NSReplicatedFileProvider is not available in Obj-C.

I have done the main app and also started plugging away with the FileProviderExtension. To verify that I have properly setup, I create a static list of files in the FileProviderExtension enumerate so I can see it work in Finder. I build the app and it works as expected and I see it mounted in Finder and I see the static list of files.

But what I don't see is any debug statements in the app, none of those message show up in the logs. I am baffled by this. I check the log stream to see what the process prints out and I know it is logging everything else eg:

2025-07-18 11:32:05.772364-0700 0x19ea3f9  Activity    0x1172100            63622  0    DriveFileProviderExtension: (libsystem_secinit.dylib) AppSandbox
2025-07-18 11:32:05.794609-0700 0x19ea3f9  Activity    0x1172101            63622  0    DriveFileProviderExtension: (libsystem_info.dylib) Retrieve User by ID
2025-07-18 11:32:05.800179-0700 0x19ea3f9  Default     0x0                  63622  0    DriveFileProviderExtension: (ExtensionFoundation) [com.apple.extensionkit:default] Extension `/Users/radwar/Library/Developer/Xcode/DerivedData/Drive-fxfhbjutfvumoabnnfmxxstpifha/Build/Products/Debug/Drive.app/Contents/PlugIns/DriveFileProviderExtension.appex/Contents/MacOS/DriveFileProviderExtension` of type: `1` launched.
2025-07-18 11:32:05.801453-0700 0x19ea3f9  Default     0x0                  63622  0    DriveFileProviderExtension: (RunningBoardServices) [com.apple.runningboard:connection] Initializing connection
2025-07-18 11:32:05.803083-0700 0x19ea3f9  Default     0x0                  63622  0    DriveFileProviderExtension: (RunningBoardServices) [com.apple.runningboard:process] Removing all cached process handles
2025-07-18 11:32:05.803231-0700 0x19ea613  Default     0x0                  63622  0    DriveFileProviderExtension: (RunningBoardServices) [com.apple.runningboard:connection] Sending handshake request attempt #1 to server
2025-07-18 11:32:05.803414-0700 0x19ea613  Default     0x0                  63622  0    DriveFileProviderExtension: (RunningBoardServices) [com.apple.runningboard:connection] Creating connection to com.apple.runningboard
2025-07-18 11:32:05.803459-0700 0x19ea613  Default     0x0                  63622  0    DriveFileProviderExtension: (libxpc.dylib) [com.apple.xpc:connection] [0x12f106e10] activating connection: mach=true listener=false peer=false name=com.apple.runningboard
2025-07-18 11:32:05.805893-0700 0x19ea613  Default     0x0                  63622  0    DriveFileProviderExtension: (RunningBoardServices) [com.apple.runningboard:connection] Handshake succeeded
2025-07-18 11:32:05.805955-0700 0x19ea613  Default     0x0                  63622  0    DriveFileProviderExtension: (RunningBoardServices) [com.apple.runningboard:connection] Identity resolved as xpcservice<clio.Drive.DriveFileProviderExtension([osservice<com.apple.FileProvider(501)>:990])(501)>{vt hash: 247410607}[uuid:454E32DB-3FB4-4DC6-9C05-F4B2F97333E0]{persona:9EF54117-4998-4D72-83C4-F12587C95FBA}

but none of my print lines are being printed. I have code like this sprinkled through the methods:

        print("🔍 FileProviderExtension INIT - Logger configured")
        print("🔍 Domain: \(domain.displayName)")

None of these show up anywhere. I also do a pure log stream with all system output, and there, too, I don't see anything. What am I missing? With my Obj-C version, all NSLogs used to show up as expected. With Swift, am I missing something?

Answered by DTS Engineer in 849893022

I generally recommend that folks log using the system log, rather than print(…), and this is a good example of why. When Xcode runs a program, it hooks stdout, stderr, and the system log and displays the results in the Console window. However, that doesn’t work when some other part of the system runs the program. For an app extension, like a file provider extension, stdout and stderr are connected to /dev/null and system log entries go straight to the system log. You can view the latter in using the Console app or the log tool.

For lots of advice on how to use the system log effectively, see Your Friend the System Log.

Share and Enjoy

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

I generally recommend that folks log using the system log, rather than print(…), and this is a good example of why. When Xcode runs a program, it hooks stdout, stderr, and the system log and displays the results in the Console window. However, that doesn’t work when some other part of the system runs the program. For an app extension, like a file provider extension, stdout and stderr are connected to /dev/null and system log entries go straight to the system log. You can view the latter in using the Console app or the log tool.

For lots of advice on how to use the system log effectively, see Your Friend the System Log.

Share and Enjoy

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

That was it, I switched to system log and the logger and now all is well. Thanks!

Unable to see *any* debug statements from the FileProviderExtension spawned from Finder
 
 
Q