Console
The Console application (path: /Applications/Utilities/Console) is literally a window into the other side of Mac OS X. While the system is running, the GUI hides a tremendous amount of information from the user. Important information is sent to the Unix Console device (/dev/console). On many Unix systems, the console actually is a separate device, such as a VT100 terminal display that displays any data sent to it. This exists as a virtual device on Mac OS X and is responsible for reporting information as it arrives.
Viewing Console Logs
The Console application enables you to watch error and status messages as they appear. If your computer appears to be stalled or is acting in an unusual manner, the Console might be producing information that can help debug the problem. Figure 3.54 shows the Console application.
Even on a properly working Mac OS X system, the Console displays error and warning messages. You'll often see a large amount of information related to system processes such as lookupd. lookupd is a system process that handles network DNS service, user information lookups, and anything else that accesses the Mac OS X NetInfo database. Each request for information from lookupd is given a time-to-live. If that time is exceeded, the request fails and is logged to the console. In a networked environment, such failures are common, and the system simply repeats the action until it succeeds.
Figure 3.54 The Console shows internal system error and status messages as they appear.
What Is NetInfo?
NetInfo is a database system that stores most of the functional information about the Mac OS X's base configuration. This database can be set up to distribute information across a Mac OS X networkenabling a single user to access his resources from anywhere on the network. Windows users will find a similarity between NetInfo and the Windows registry. NetInfo, however, is easier to work with and existed many years before the registry (in the form of NeXT Computer's NeXTSTEP). More information on NetInfo is provided later in this book.
Managing the Log View
To filter the Log view, use the filter field in the upper-right corner to enter a string that each line must match to be displayed. For example, to display information from the Safari Web browser, you would type Safari.
To clear the filter, either remove the string, or click the "X" icon at the end of the field.
You can also use the toolbar icons to Mark the log, which enters a time stamp into the log display, or to clear the display entirely. This does not modify the actual log files, just the information display. To reload the full log at any time, click the Reload button, or use File, Reload (Command-R).
TIP
Additional functions (such as a full Find pane) can be added to the toolbar using View, Customize Toolbar.
Viewing Other Log Files
The Mac OS X System maintains a great deal of log information in addition to what is sent directly to the console. The Console application can display the contents of any log that you want if you choose File, Open from the menu. As you read through the book, you'll find that many BSD services create their own log files.
Logs are stored in three key locations: Your home directory (~/Library/Logs), the System log directory (/Library/Logs), and the BSD log directory (/var/log). Console is already "aware" of these locations and allows you to browse logs stored here by clicking the Logs icon in the toolbar. This opens a pane on the left side of the window, as shown in Figure 3.55.
Figure 3.55 Browse other logs on your system.
Use the disclosure arrows to browse to other logs located on your drive. Alternatively, you can use File, Open Quickly to also browse the log hierarchy to a log of your choosing.
To save a copy of the log you are viewing, or a portion of it, choose File, Save a Copy As or File, Save Selection As (Option-Command-S).
Preferences
Use the Console application preferences to pick a delay that will be used for displaying log information as it comes in. If the console application is running but hidden when incoming information is received, clicking the Bring Updated Log Window to Front check box causes the application to appear and display the new information. The Send Back slider is used to set the length of the delay before the Console application hides itself.
Click Bounce Icon When Log Is Updated to cause the dock icon to bounce when there are incoming messages.