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
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. [View full size image] | 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. [View full size image] |
|