Can I have launchctl output stdout/stderr from my application to the system-wide Unified Logging mechanism?
10
votes
1
answer
5741
views
I have set up a custom
.plist
in ~/Library/LaunchAgents
to run a process (offlineimap ) on a periodic basis. I've specified both the StandardOutPath
and StandardErrorPath
keys to point to files in my home directory, which works. However, this doesn't really provide a complete logging solution from what I can see. The logs are not rotated, there are no timestamps (addressed by this question , although there was no clear answer), and the log is not integrated into any other logging on the system. I think I would prefer it if the logs went to Unified Logging .
I'm used to systemd logging on Linux, which is a similar mechanism, and it would be great if there was a similar way I could redirect that output into the system-wide log, viewable with the log
command. Is there any way to do that with a custom LaunchAgent?
I should add that I'm using MacOS 10.14.5.
Asked by Andrew Ferrier
(3520 rep)
May 12, 2020, 03:49 PM
Last activity: Nov 19, 2024, 09:03 PM
Last activity: Nov 19, 2024, 09:03 PM