Hi all,
I'm working on a non-interactive macOS application (a service or daemon), and I'm trying to understand the best practices around logging and error reporting, particularly in failure scenarios.
If a daemon or service fails in macOS, where is it expected to log errors, and how can users or developers discover what went wrong?
Specifically, I have a few questions:
What is the recommended location or system for logging errors from a non-interactive macOS application?
Should we use os_log, standard error output, or write directly to files somewhere?
How can a user or developer access these logs to diagnose issues—should logs be visible via the Console app?
Is there a standard approach to making failure information easily accessible for debugging and support, especially for daemons running under launchd?
Any guidance or best practices would be appreciated.
My general advice is that you log to the system log. I have a bunch of info and links to official docs in Your Friend the System Log. I think that’ll answer all of your questions but, if not, feel free to reply here with any follow-ups.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"