The log /var/log/messages shows most system messages, and as such it is useful for debugging all sorts of problems. …
Most system messages go to /var/log/messages: non-kernel boot errors, messages from most application-level services, post-boot kernel messages, and more are written to this file. While there are many specialized log files on a Linux box, /var/log/messages is a good first place to look whether troubleshooting or simply making sure that all is in order.
On Ubuntu 11.4 and later, substitute /var/log/syslog for /var/log/messages.
/var/log/messages is not world-readable; you need root privileges to view it.
The log is organized chronologically, newest entries last. So to view the most recent messages, tail -50 /var/log/messages, replacing 50 with however many messages you want to see. You might use this to see what was logged a moment ago.
To view the entire log, less /var/log/messages. If you prefer to open it in a text editor, you will be continually interrupted by warnings that the original file has changed unless you first copy the log, then open the copy. For example:
# cp /var/log/messages /tmp/ & bluefish /tmp/messages &
To view current messages in real time, tail -f /var/log/messages. Messages will now scroll by as logged until stopped with Ctrl-C. You might use this to see what is logged as you perform an action.
Consider adding /var/log/messages to your backup set as an aid to future diagnostics. Don't do this if you use a sync-based backup: being ever-changing, the file can overrun your storage medium.