Hostingheaderbarlogoj
Join InMotion Hosting for $3.49/mo & get a year on Tuts+ FREE (worth $180). Start today.
Advertisement

Beginner's Guide to Console

by
Gift

Want a free year on Tuts+ (worth $180)? Start an InMotion Hosting plan for $3.49/mo.

Final product image
What You'll Be Creating

A well written program on the Mac will log messages to the system log. Anyone can view the log using Mac’s Console program, but very few people know about it. In this tutorial, I'll show you how to use the Console and the different things you can do with it.

Opening Console

Opening Console from Dock
Opening Console from Dock

To open Console, go to the Utilities directory under Applications in the Dock.

Opening Console from Spotlight
Opening Console from Spotlight

Or, open Spotlight and launch it from there.

Opening Console from Alfred
Opening Console from Alfred

If you have Alfred, you can type console in the Alfred prompt.

Opening Console from LaunchBar
Opening Console from LaunchBar

If you have LaunchBar, you can open it with Console as well.

Console Main Window
Console Main Window

Whichever way you launch Console, the program will show a lot of information on the main window. What you see is every message that every program you are running sends to the System Log

The System Log is a unified way to store information about program states on the Mac. Typically, each line shows the time recorded and the message given from the program.

Button Bar Functions

The first button in the button bar is Show Log List. This will open a side-panel to the left and show all the files that it reads log information from to generate the list.

Show Log List
Show Log List

The All Messages area has entries from each of these files. If you select a single file, it will display information from that file.

The Clear Display button clears everything in the main window area. This comes in handy to see new messages.

The Reload button will reload the information from all the log files. Therefore, if you Clear Display or Ignore Sender, the information hidden is re-written to the list.

The Ignore Sender button gives a way to narrow down the information. Select an entry, click the Ignore Sender button, and every entry from that sender is not shown. You can reverse it by doing a Reload.

Selecting Sender to Ignore
Selecting Sender to Ignore

In my Console window, I have many entries from com.apple.time that I do not need to see. By selecting one of them…

Ignoring the Sender
Ignoring the Sender

and then pressing Ignore Sender, all lines from the com.apple.time sender get removed. To undo this, press Reload and they will be back.

Inserting a Marker From the Menu
Inserting a Marker From the Menu

With the Insert Marker, you can put a time stamped entry at that location. The first time you do one, I have found it necessary to do it from the View menu. After that, you can do it from the button just fine.

The Inserted Marker
The Inserted Marker

With the marker in place, you can go back to work. When you check it again, you can easily see the marker and any newer entries.

Inspector
Inspector

The Inspector button turns on and off an entry inspector. When you select an entry and press Inspector, more detailed information about the selected entry gets shown in an easy to read format. You can move this windows over to the side and select different entries. The Inspector will show the information for that entry.

Filter
Filter

The last item is the Filter. This looks like a search box, but is rather a way to remove all entries except for the ones that match the string in the Filter box. Therefore, if you know a piece of text you need to find in the logs, type it in the Filter box and every entry with that text will show up. Looking for all FIXME text strings really gives a large number of entries. Looks like a bug!

Debugging

Those FIXME entries show that I have a definite bug that I have to fix. The message mostly comes from the SystemUIServer process. This process takes care of external hardware attached by my computer. The string it shows is BBFFFLO? 

Since I have a Buffalo USB hard drive, that’s probably the problem.

Debugging the FIXMEs
Debugging the FIXMEs

After I unmounted and removed the Buffalo USB drive, I placed a marker after the last entry of that type. By inspecting the previous log entries, I can see that I am getting a FIXME entry 12 times a second! Thirty minutes latter and I have no messages. That was definitely the problem.

Plugging the Usb Drive Back Up
Plugging the Usb Drive Back Up

As soon as I plug the Buffalo Drive back up, I instantly start having those messages again. I also notice that the diskarbitrationd process has the same issue. It must be the volume name of the disk isn’t written using UTF–8 characters.

By searching the Internet, I found out how to change the volume name. No more problems. Now, my log files will be much smaller! Not only that, but access times to the external hard drive improved greatly.

Conclusion

That bad volume name shows the value of the Console program. By inspecting the Console every now and then, you can get a feel for the health of your system, spot suspicious errors, and keep your system running the best it can. Searching the Internet for the processes shown in the Console will help you narrow down the issue until you can fix it yourself.

Advertisement