Question: logs

Hi Chris,

Thanks again for yesterday, good to meet you!

I have a small question about logs in MW. By default, are stdout and stderr of the server and client saved anywhere? (I can launch from the command line but I had a bug hit during an overnight test last night and I want to see if I can figure out what happened.)

Also, is the server console log saved anywhere by default? Same story - if the buffer fills up the the earlier entries are lost and I want to see if I can figure out what happened.

Thanks,
Mark

Hi Mark,

Anything written to stdout and stderr, along with any messages written via NSLog(), should end up in /var/log/system.log . You can either read this file directly (e.g. with less) or view the messages via /Applications/Utilities/Console.app . If you’re looking for messages from last night, you may have to look in one of the rollover files (e.g. system.log.0.bz2).

FYI, in my experiments with MWClient, I’ve found that stuff written to stderr or sent to NSLog shows up in the log immediately, whereas stdout appears to be buffered and may not be flushed until the application exits.

As for the server console log, I don’t believe that it’s ever saved automatically. If you want a copy of the current log messages, you have to manually click the “Save” button in the console window toolbar.

Chris

One other note: everything that gets posted to the MWServer console also gets dumped to a data file if one is being streamed. So, if you’re running a long test with a low-probability problem, you can start streaming a data file before you begin and interrogate the contents later.

Data streamed to disk is continuously buffered and written out in a separate thread, so there is some chance that if your problem is a crash, it could bring down the system quickly enough that you still might not see the messages (i.e. if the write thread hasn’t caught up). In this case, your best recourse is to run the application in gdb and catch it in mid-crash.

Thanks, guys. This answers my questions.
(I ended up catching the problem by running the server in GDB. It’s an issue in the usb stack and I am looking into that now.)

best
M