KDE 4: KSystemLog Reveals Your Log Files

by Paul Arnote (parnote)

Most of you reading this already know that PCLinuxOS is an incredibly stable operating system. But, as with any computer operating system, things may sometimes go awry. And when it does, you are likely to find clues to your problem in one of the many log files maintained on a regular basis in PCLinuxOS. Fortunately, PCLinuxOS users have two excellent ways to access those log files: either through the PCLinuxOS Control Center (PCC), or through a KDE 4 utility, called KSystemLog.

pic

The PCC utility is located under System > Administration Tools > View and Search System Logs, when you launch PCC. From it, you can select which log files you want to search through. In the example screen shot, I've marked all five categories of log files.

At the top of the window, you type in the term you are searching for. I've used the term "linux," but you can just as easily type in "eth0" or "video" or any other term you want to search for.

Drop down vertically to the middle of the window, and click on the "Search" button to conduct your search. The bottom portion of the window shows your search results, under "Content of the file."

At the very bottom of the window, you are given the choices to "Mail alert," "Save" the data, or "Cancel" the operation.

You can also restrict your search to only include data specific to the selected day, in the upper right corner of the window by simply checking the box above the calendar that is displayed. You can also further refine your search by specifying a term you wish to exclude from your search results, by filling in that term in the "but not matching" box.

Of course, the PCC method of viewing and searching your log files is available to every user running any version of PCLinuxOS, regardless of the desktop environment you are using. Just remember you will have to supply a search term. However, if you are running KDE 4, you have another choice that allows you to view your log files, without specifying a search term. You can use KSystemLog, which is installed from Synaptic as part of the KDEAdmin4 package. KSystemLog is designed to make it easy for beginning KDE users to find the various system logs on their system, but also designed to make the log files accessible and useful for more experienced users.

pic

Just as with PCC, you will need to supply your root password when launching KSystemLog. When it opens, you are presented with the System Log preloaded, as in the second screen shot.

If you want to view a different log file, simply click on one of the log files listed across the top of the KSystemLog window, or select one from the "Logs" menu (there are quite a few more log files listed under the "Logs" menu than just those listed across the top of the window). By doing so, the log you select will replace the System Log in the main window.

KSystemLog also sports a multiple tab interface, so you can view multiple log files at one time. By pressing Ctrl + T, or by selecting Window > New Tab from the menus, you can open up a new tab, and select which log file you would like to view in that tab.

pic

If you select a log file that does not exist, or cannot be found in the default location, you will receive the following error message box:

pic

Fortunately, there are quite a few configuration options for KSystemLog.

pic

Under the General section, you can specify which log file you want to be loaded by default when KSystemLog starts. The default is System Log, but you can choose to have no log file automatically loaded, or you can choose from 16 other log files. They include:

  • ACPI Log
  • Apache Access Log
  • Apache Log
  • Authentication Log
  • Cron Log
  • Cups Web Log1000
  • Cups Log
  • Cups Page Log
  • Cups PDF Log
  • Daemons' Log
  • Kernel Log
  • Postfix Log
  • Samba Access Log
  • Samba Log
  • X.org Log
  • X Session Log

Right below the selection of the log file to load when KSystemLog starts, you can specify how many lines of the log file to load. Some of the log files, due to how complete and complex they are, can become quite long. The default number of lines to load is 1,000. In the example above, I've increased the maximum number of lines to 2000. You also have an option to remove duplicate lines, although doing so may cause slower loading of the log files.

When you select the individual log files listed on the left side of the Configuration, you are given the chance to specify a different location where each log file resides, just in case log files are stored in different locations from Linux distro to distro.

pic

Somewhat surprisingly, the Boot Log was left out of the choices you can choose to view. Never fear, as you have a couple of options. First, you can simply point one of the log file categories to load the Boot Log, instead of the one it's suppose to display. The only shortcoming to this is that the Boot Log will always be displayed with the name of the category you chose to change. For example, if you specify the Boot Log in place of the Apache Access Log, the label will still read Apache Access Log, while displaying the Boot Log. The other way to display the Boot Log is to add it to the end of the System Log. Select "Add File ..." from the configuration dialog box, and select the Boot Log from the list of logs that occupy /var/log.

With KSystemLog, you can search the log file being currently displayed (Edit > Find...). You can also save the log file (File > Save), and you can even add an entry to the currently displayed.

All in all, Linux is about choice. Every PCLinuxOS user can view and search the log files on their system through PCC. And KDE 4 users have another choice to use the KDE 4 tool, KSystemLog.