views:

88

answers:

2

With the application Utilities/Console.app, I can see the console output of applications.

Is there a way to access this log from another application?

To be more specific: I am writing a crashhandler for my application and I want that it attaches the console output to the crash information.

A: 

Ah, just found out that there is the file /var/log/system.log which contains those information.

Albert
It seems that the output is not there in all cases and also with some delay, so this is not really that helpfull.
Albert
A: 

/var/log/system.log was not really a solution because the output didn't immediatly appeared there (which was a big problem because how should my crash handler know that everything is complete there), also the grepping of the related messages was very hackish and then, when I started several instances of the application, I didn't really know about the correct related output (unless I knew the pid but even then, also the pid is not unique).

Know, a solution I am very happy with, is that the application itself is keeping track about all the console output. It is doing that by forking itself and piping its output to the fork and emulating the tee tool there, where one output is a special log file. When it crashes, it sends the filename of the logfile to the crashhandler.

If you are interested, look at the OpenLieroX source code ( http://sourceforge.net/projects/openlierox ).

Albert