Understanding Logs


Unix systems traditionally record interesting events, such as services' starting or stopping, errors encountered while reading configuration files, or anything else that strikes the program author's fancy. These logs can contain important information about failing services.

To find system logs

  • The system logs are usually stored as regular files, although there are a couple (such as /var/adm and /var/log/wtmp) that contain binary data and aren't meant for human consumption.

     cd /var/log 

    The files and directories in /var/log, the standard log file directory, make up the system log. Various application log files are also stored there.

To read log entries

  • Entries in the system log files almost always follow the same pattern:

     date time [process] message 

    The date and time should be self-explanatory, and the process is the name of the program that made the log entry (it might also contain the name of the host that sent this log message). The message could be literally anything, but it should tell you what the programmer was recording in the log.

To write log entries

  • You can create your own log entries, which might be useful in a shell script.

     logger message 

    Write message to the system log (/var/log/ messages on Fedora Core and FreeBSD, the system Event Viewer on Cygwin, and /var/log/system.log on Mac OS X).

To view system logs with Webmin

Finding the right log can be frustrating, but Webmin gives you a handy list to choose from.

1.

Bring up Webmin in your favorite Web browser and log in.

2.

Click the System icon in the toolbar at the top of the page. This displays the System tools page (Figure 3.18).

3.

Click the System Logs icon to display the System Logs page (Figure 3.22).

Figure 3.22. Webmin's System Logs page lists all of the system logs and tells you whether each log is active or not.


4.

Click the View link for the log you're interested in to display the View Logfile page (Figure 3.23).

Figure 3.23. Viewing a log file with Webmin.




    Unix Advanced. Visual QuickPro Guide
    Unix Advanced: Visual QuickPro Guide
    ISBN: 0321205499
    EAN: 2147483647
    Year: 2003
    Pages: 116

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net