Save event log output?

The event log is obviously crucial to debugging scripts. But once I have my scripts working properly, I run them all through cron. I would really like to be able to get the event logs saved every time my AS is run so that I can go back through them (rather than just have errors mailed to me through cron). Is this possible?

I don’t think there is a flag to get event history from a compiled script executed with osascript… only errors go to stdout. I think you’ll have to add your own logging code to your script. Maybe Leopard has something new. Don’t know.

I have a similar question.

I wrote a script and shared it via the web, but many people are encountering errors. I want to streamline the debug process, such that if the script fails, it will compose an email to me that contains the event log. I can do all this, except that I can’t find a way to access the event log contents.

Is there a way for me to save the contents of the event log (or event log history) ?

Any help would be greatly appreciated.

the event log can only be read if the script runs in any developer environment like Script Editor or Script Debugger

For a stand alone solution you have to add your own logging code