Log Monitoring
| Contents Monitoring Apache Log Monitoring Log Management Configuration Management Security and Passwords Keeping Apache Up to Date Other Systems and Extensions Scheduling Maintenance |
|---|
Checking logs is the best way to find out what is going on. Apache 2.0 introduced the generation of a separate error log for the Apache process itself. Checking this, often, is the best way to find out if something needs attention, as examining the logs makes it easy to catch a faulty or missing module or a bad process. Consider this sample fragment:
|
|---|
All log entries are marked with a particular class in much the same way as entries in the system log are marked under the various Unix variants. Log levels include ‘notice’, which is for notification information only; ‘info’, which relates to running or log information; ‘debug’, which is output when debugging on a module is enabled; and ‘warn’, which notifies of a series problem.
Checking Web host logs should also be a regular activity. These highlight problems with missing files, errors in CGI scripts, and users trying to access files and directories that no longer exist. Note, though, that some errors from a site are to be expected, even if everything tests out okay elsewhere.
The important things to look out for are unexpected items, rather than missteps you might repeatedly be making. For example, say you frequently forget to add a ‘favicon’ to your sites; you would then get many errors with browsers looking for a file which will never exist. But errors in a CGI or other item you would want to know about.
If you are on a Unix system, and using the standard error log format, the following command generates a unique list of errors from a log file:
|
|---|
pulls out the most recent 100.
|
|---|
searches the entire file.
To monitor the significance, add ‘-c’ to the uniq command, which will find you a count of the number of each error.