macOS 14.4.1 borked or locked system log --stream

To help with debugging on a customers machine, this terminal command records log entries for my app and writes 'em to disk.

log stream --predicate 'process=="Sleep Aid"' --style compact > ~/Desktop/Sleep\ Aid.log

In my app I have a function that does something similar to the above with a NSTask, and then I ask the customer to repeat the action that causes the problem. However for one customer, the file is created, but apart from it saying it's being filter by process, nothing else is written.

Is there some new security setting that can prevent an app from getting its own logging data, or in this case even prevent the customer from using terminal and the above command to get the log data?

This is similar also.

https://forums.developer.apple.com/forums/thread/743803

Or should I be filing a radar about a potential bug?

Replies

tedt

The thing that immediately leaps to mind is the admin vs normal user dichotomy. Many log commands require you to be an admin user, and most developers don’t notice because they log in as an admin user by default.

Share and Enjoy

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

  • Thanks Quinn. Within the app, when the customer tries to enable the logging it will alert the customer if the NSStask response isn't 0. This has helped identify if the user can or cannot access the log in the past, but for this particular situation it doesn't fail, just none of the log data is recorded to the file.

    The customer experimented with the "show" function and was able to access past data, so it seems like "stream" may be broken on this customers Mac.

Add a Comment