Mac OS X debug tip - Check the log files

Mac OS X debug FAQ: Help, I'm having a problem with [fill in the blank] on my Mac OS X system, how do I troubleshoot it?

I just ran into a problem when trying to create a Safari web clip dashboard widget, where the web clip isn't properly updating itself, and I stopped for a moment to think about how to troubleshoot/debug this Mac OS X problem. That's when I thought, "Okay, a Mac is a Unix system, check the log files." So I cracked open a Mac Terminal window, and checked the system log file:

$ vi /var/log/system.log

Sure enough, there was a big nasty Mac WebKit error message in there. Unfortunately the error message hasn't completely helped me resolve the problem yet (an "DashboardClient[47876:a03] *** WebKit discarded an uncaught exception" error message isn't too helpful, unless you happen to be a DashboardClient WebKit developer), but it clearly stated that there was a nasty problem with my Mac web clip.

Mac debug tip - Check the Mac log files

Getting back to my reason for this blog post, in the heat of the battle I've seen even seasoned software developers and Unix system administrators lose their focus from time to time, and get frustrated with a problem, while forgetting to check the system log files. I just showed you one way to check the Mac system log file using the Mac Terminal app and vi editor, but if you're not a Unix/Linux user, there is at least one other way to check the Mac system log files, so fear not.

Debug Mac log files with the Mac Console app

An easy way to debug Mac problems and check all of your Mac OS X log files at one time is with the Mac Console application. To start the Mac Console application, just follow these steps:

  • Click Applications
  • Click Utilities
  • Click the Mac Console icon

This opens the Mac Console GUI application, which looks something like this on Mac OS X 10.6:

Mac Console app and Mac system log files (Mac debugging)
The Mac Console application.
 

As you can see, not only does the Mac Console application let you easily check the system log file (system.log) for problems, it also shows other Mac log files, which you can easily click on to view. This really makes for a nice Mac debug tool, because you can easily bounce back and forth between the different log files without requiring multiple windows.

Mac debugging and Mac system log files - Summary

I hope this tip on how to debug Mac problems by checking your Mac system log files has been helpful. As you might be able to see with my current Mac bug (my Mac dashboard widget / web clip), some times you can't see all the details you want, but you can see enough details to help identify the problem, and try a different approach. If you happen to be interested in Mac web clips, check out my How to create a custom Mac dashboard widget from a web page (web clip) tutorial. Oh, and while you have the Mac Console application open, make sure you check those "appfirewall.log" files -- you might be amazed by what's in there.

Add new comment

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.