title: How should I clean up the launchd StandardOutput or StandardError logs?
body: <p>I've got a program that runs as a launchd agent, and I have stdout and stderr sent to a log file using the <code>StandardErrorPath</code> and <code>StandardOutputPath</code> keys. I'm quite keen on having stdout/stderr logged somewhere, and it seems like having launchd set this up would be the sensible thing.</p>
  
  <p>(My intention was to suggest a file in <code>~/Library/Logs/</code> as a good setting. Then you can easily see the output in Console.app.)</p>
  
  <p>Something I've noticed though is that launchd never seems to clean up these logs! I was expecting it to clear the log on each reboot, perhaps, or every few days, or something - but it seems not to. After a couple of weeks, I've got a 7MByte 22,000-line log file, virtually none of which is relevant. (It's highly unlikely you'd care about anything that happened before the last reboot, and in fact rather unlikely you'd care about anything that didn't happen in the last 15 minutes.)</p>
  
  <p>Is there something I can do to stop the file growing indefinitely?</p>