I have a program that starts as the launchd agent, and stdout and stderr are sent to the log file using the StandardErrorPathand keys StandardOutputPath. I am very interested that stdout / stderr is registered somewhere, and it seems like running this program would be reasonable.
(My intention was to offer the file in ~/Library/Logs/as a good option. Then you can easily see the output in Console.app.)
Something I noticed is that starting up never clears these logs! I expected it to clear the log on every reboot, maybe every few days, or something like that, but it doesn't seem to be that way. After a couple of weeks, I have a 7MByte log file of 22,000 lines, almost none of which are relevant. (It is very unlikely that you took care of everything that happened before the last reboot, and in fact it is unlikely that you took care of what did not happen in the last 15 minutes.)
Is there something I can do to stop the file indefinitely?
source
share