Netscape Messaging Server can create log files that record events related to its administration, to communications using any of the protocols (IMAP, POP, SMTP, and HTTP) that the server supports, and to other processes employed by the server. By examining the log files, you can monitor many aspects of the server's operation.
Log Characteristics Defining and Setting Logging Options Searching and Viewing Logs Analyzing Logs with Third-Party Tools Selected Event-Message Formats Interface Reference: Logging and Log Files
Messaging Server creates a separate set of log files for each of the major protocols, or services, it supports. You can customize and view each type of log file individually. Table 11.1 lists the services that can be logged, and describes the log files for each service.
Table 11.1 Logged services
The level, or priority, of logging defines how detailed, or verbose, the logging activity is to be. A higher priority level means less detail; it means that only events of high priority (high severity) are logged. A lower level means greater detail; it means that more kinds of events are recorded in the log file.
Table 11.2 Levels of Logging
Within each supported service or protocol, Messaging Server further categorizes logged events by the facility, or functional area, in which they occur. Every logged event contains the name of the facility that generated it. These categories aid in filtering events during searches. Table 11.3 lists the facilities that Messaging Server recognizes for logging purposes.
Table 11.3 Facilities in which log events occur
All log files created by Messaging Server use identical naming conventions. Each log file has a filename of the form:
service.sequenceNum.timeStamp
Table 11.4 Log filename conventions
All log files created by Messaging Server have identical content formats. Log files are multiline text files, in which each line describes one logged event. All event descriptions, for each of the supported services, have the general format:
dateTime hostName processName[pid]: facility logLevel: eventMessage
Table 11.5 Log file components
02/May/1998:17:37:32 -0700 showshoe cgi_store[18753]: General Notice: Log created (894155852)
04/May/1998:11:07:44 -0400 xyzmail cgi_service[343]: General Error: function=getserverhello|port=2500|error=failed to connect
03/Dec/1998:06:54:32 +0200 AiriusPost imapd[232]: Account Notice: close [127.0.0.1] [unauthenticated] 1998/12/3 6:54:32 0:00:00 0 115 0
Every logged service is assigned a single directory, in which its log files are stored. All IMAP log files are stored together, as are all POP log files, and log files of any other service. You define the location of each directory, and you also define how many log files of what maximum size are permitted to exist in the directory.
The naming scheme for log files (service.sequenceNum.timeStamp) helps you to design a flexible log-rotation and backup policy. The fact that events for different services are written to different files makes it easier for you to isolate problems quickly. Also, because the sequence number in a filename is ever-increasing and the timestamp is always unique, later log files do not simply overwrite earlier ones after a limited set of sequence numbers is exhausted. Instead, older log files are overwritten or deleted only when the more flexible limits of age, number of files, or total storage are reached.
Keep in mind that you must set several limits, more than one of which might cause the rotation or deletion of a log file. Whichever limit is reached first is the controlling one. For example, if your maximum log-file size is 3.5 MB, and you specify that a new log be created every day, you may actually get log files created faster than one per day if log data builds up faster than 3.5 MB every 24 hours. Then, if your maximum number of log files is 10 and your maximum age is 8 days, you may never reach the age limit on log files because the faster log rotation may mean that 10 files will have been created in less than 8 days.
Maximum number of log files in directory: 10 Maximum log-file size: 2 MB Total maximum size permitted for all log files: 20 MB Minimum free disk space permitted: 5 MB Log rollover time: 1 day Maximum age before expiration: 7 days Level of logging: Notice
You can use Netscape Console to set options that control the logging configuration for each Messaging Server service.
In Netscape Console, open the Messaging Server whose log file options you want to set.
Click the Configuration tab, open the Log Files folder in the left pane, and select the log files of a service (such as IMAP, SMTP, HTTP, or Admin).
From the "Levels of detail" drop-down list, choose a logging level.
Set a level of logging that is consistent with your storage limits--that is, a level that you estimate will cause log-data accumulation at approximately the rate you used to estimate the storage limit.
In the "Directory path for log files" field, enter the name of the directory to hold your log files.
In the "File size for each log" field, enter your maximum log-file size.
Define the log file size so that searching performance is not impacted. Also, coordinate it with your rotation schedule and your total storage limit. Given the rate at which log entries accumulate, you might set a maximum that is slightly larger than what you expect to accumulate by the time a rotation automatically occurs. And your maximum file size times your maximum number of files might be roughly equivalent to your total storage limit.
Example: If your IMAP log rotation is daily, your expected accumulation of IMAP log data is 3 MB per day, and your total storage limit for IMAP logs is 25 MB, you might set a maximum IMAP log-file size of 3.5 MB. (In this example, you could still lose some log data if it accumulated so rapidly that all log files hit maximum size and the maximum number of log files were reached.)
In the "Create new log every" field, enter a number for the log-rotation schedule.
In the "Number of logs per directory" and the "When a log is older than" fields, enter the maximum number of log files and a maximum age to coordinate with your backup schedule.
Example: If server backups are weekly and you rotate IMAP log files daily, you might specify a maximum number of IMAP log files of about 10 (to account for faster rotation if the individual log-size limit is exceeded), and a maximum age of 7 or 8 days.
In the "When total log size exceeds" field, enter the total storage limit you want.
Pick a total storage limit that is within your hardware capacity and that coordinates with the backup schedule you have planned for the server. Estimate the rate at which you anticipate that log data will accumulate, add a factor of safety, and define your total storage limit so that it is not exceeded over the period between server backups.
Example: If you expect to accumulate an average of 3 MB of IMAP log-file data per day, and server backups are weekly, you might specify on the order of 25 - 30 MB as the storage limit for IMAP logs (assuming that your disk storage capacity is sufficient).
In the "When free disk space is less than" field, enter the minimum amount of free disk space you want to reserve.
For safety, pick a minimum amount free disk space that you will permit on the volume that holds the log files. That way, if factors other than log-file size cause the volume to fill up, old log files will be deleted before a failure occurs from attempting to write log data to a full disk.
You can also set logging options at the command line as follows.
configutil -o logfile.service.loglevel -v level
configutil -o logfile.service.logdir -v dirpath
configutil -o logfile.service.maxlogfilesize -v size
configutil -o logfile.service.rollovertime -v number
configutil -o logfile.service.maxlogfiles -v number
configutil -o logfile.service.maxlogsize -v number
configutil -o logfile.service.minfreediskspace -v number
configutil -o logfile.service.expirytime -v number
These are the search parameters you can specify for viewing log data:
A time period. You can specify the beginning and end of a specific time period to retrieve events from, or you can specify a number of days (before the present) to search. You might typically specify a range to look at logged events leading up to a server crash or other occurrence whose time you know of. Alternatively, you might specify a day range to look at only today's events in the current log file.
A level of logging. You can specify the logging level (see Levels of Logging). You might select a specific level to uncover a specific problem; for example, Critical to see why the server went down, or Error to locate failed protocol calls.
A facility. You can specify the facility (see Facilities as Categories of Logged Events). You might select a specific facility if you know the functional area that contains the problem; for example, Store if you believe a server crash involved a disk error, or Protocol if the problem lies in an IMAP protocol command error.
A text search pattern. You can provide a text search pattern to further narrow the search. You can include any component of the event (see Content Format for Log Files) that can be expressed in a wildcard-type search, such as event time, process name, process ID, and any part of the event message (such as remote host name, function name, error number, and so on) that you know defines the event or events you want to retrieve.
Your search pattern can include the following special and wildcard characters:
* Any set of characters (example: *.com) ? Any single character (example: 199?) [nnn] Any character in the set nnn (example: [aeiou]) [^nnn] Any character not in the set nnn (example: [^aeiou]) [n-m] Any character in the range n-m (example: [A-Z]) [^n-m] Any character not in the range n-m (example: [^0-9]) \ Escape character: place before *, ?, [, or ] to use them as literals
Specifying Account facility (and Notice level) to display failed logins, which may be useful when investigating potential security breaches
Specifying Network facility (and all logging levels) to investigate connection problems
Specifying all facilities (and Critical logging level) to look for basic problems in the functioning of the server
Follow these steps to search for logged events with specific characteristics belonging to a given service:
In Netscape Console, open the Messaging Server whose log files you want to inspect.
Follow either of these steps to display the Log Files Content tab for a given logged service:
Click the Tasks tab, then click "View service logs", where service is the name of the logged service (such as "IMAP service", "SMTP service", or "administration").
Click the Configuration tab, then open the Log Files folder in the left pane and select the log files of a service (such as IMAP, SMTP, or Admin). Then click the Content tab in the right pane.
The Content tab for that logged service is displayed.
In the Log filename field, select the log file you want to examine.
Click the View selected log button to open the Log Viewer window.
In the Log Viewer window, specify your desired search parameters (described in the previous section, Search Parameters).
Click Update to perform the search and display the results in the Log entry field.
The event message for an SMTP-Accept log entry has the format
moduleName:envelopeID:mailFrom:[peerAddress]:peerHost:msgID:msgSize: numRecipients:recipientList
Table 11.6 SMTP-Accept event message elements
[08/Sep/1998:19:04:24 -0700] dizzy smtpd[8379]: General Notice: SMTP-Accept:0EYZV320.6U1:<aswe32dasdf@netscape.com>:[127.0.0.1]: 127.0.0.1:<pkeni@netscape.com>:272:1:<dizzy2@dizzy.mcom.com>
The event message for an SMTP-Deliver log entry has the format:
moduleName:envelopeID:mailFrom:status:destHost:msgID:msgSize: numRecipients:recipientList
Table 11.7 SMTP-Deliver event message formats
[08/Sep/1998:19:04:02 -0700] dizzy smtpd[8379]: General Notice: SMTP-Deliver:0EYZV2Q0.8C0:<aasdfasdfds@netscape.com>:Delivered: c3po.netscape.com:<pkeni@netscape.com>:337:1:<pkeni@netscape.com>
The event message for a Mailbox-Deliver log entry has the format:
moduleName:envelopeID:msgSize:msgID:userID
Table 11.8 Mailbox-Deliver event message elements
[31/Jul/1998:16:50:56 -0700] slug smtpd[19530]: General Notice: Mailbox-Deliver:0EWZGWV0.02Z:17943:<12345678.123@nowhere>:slug464
Searching and Viewing LogsLog Characteristics
Specify time period. Click this radio button to enter a starting and ending date and time for searching. If the button is selected, only events that occurred between the times you specify are displayed. Click the Edit button to access the Date-Time Window to specify the times.
Log entry. This field displays (in two panes) logged events from the current log file. (The file whose contents are displayed here has been selected through the Content tab for a specific logged service; see Log Files Content Tab.)
Close. Click this button to close the Log Viewer window.
Log CharacteristicsLevels of LoggingDefining and Setting Logging Options
Note: Log data can be voluminous. Choose a directory that has adequate disk storage space and in which your log files will not overwhelm other files.
File size for each log. In this field, specify the maximum size permitted for a log file of this type; from the associated drop-down list, choose Mbytes or Kbytes. When the file currently being written to exceeds that size, subsequent events are written into a new file, named according to the conventions that are described in Filename Conventions for Log Files.
Caution: If you do not want to lose log data, make sure you adjust your log-rotation parameters and backup schedule (see Defining and Setting Logging Options) so that files are not deleted before they have been backed up.
Number of logs per directory. In this field, specify the maximum number of log files permitted in the directory specified in the "Directory path for log files" field. When this number of files is exceeded, the oldest log file in the directory is deleted.
Caution: If you do not want to lose log data, make sure you adjust your log-expiration parameters and backup schedule (see Defining and Setting Logging Options) so that files are not deleted before they have been backed up.
Save. Click this button to commit any settings you have made in the Log Files Option tab.