All POPular programs log directly into files.
syslog
is not used. The default log directory is
/var/log/popular. This directory should
be owned by the user running all the commands and only writable by this
user. The commands pproxy, pserv,
pcheckd, psmtpd, and
pdeliver write to a logfile named after the command.
The log file format is carefully designed to be easily greppable in shell or Perl scripts. The date and time stamps use the compact ISO 8601 format, which is concise, unambiguous and easily sortable. See http://www.cl.cam.ac.uk/~mgk25/iso-time.html for details.
Each log entry is in one line and contains the following fields separated by a space character:
Date | In the ISO format YYYYMMDD. |
Time | In the ISO format HHMMSS. |
Hostname | The hostname without domain. |
Program | The name of the program logging this event. |
Process ID | The process ID of the program logging this event. |
Session ID | This ID is the same for all log lines belonging to the same session. It is build from the contents of the sidprefix config variable, the start time of the session and the process ID of the pproxy process handling this session. For the same session, the session ID is the same in both the pproxy and the pserv logs. If there is no session ID associated with this log line a single hyphen ('-') is printed. |
Level | The level of this message. See below for a list of logging levels. |
Unique message number | A unique 4-digit hex number for this logging message. A list of all numbers and their corresponding messages and meanings is automatically generated from comments in the source code. These numbers are not reused if they are retired after a program change. For debug messages this number if always '0000'. A list of all message numbers along with a description what they mean is available from the popular-log(7) man page. |
Name | This is a description of the event causing this log entry. This is always a single word, if necessary underscores are used. This makes the log messages easily 'grep'able. Debug messages print different information here, see below. |
Additional text | Additional text like human readable error messages, usernames, IP addresses, etc. This is the only field in a log line, which can contain spaces. Non-printable chars are escaped. If a message if too long, it will be truncated and '...' added. |
Debug messages use a slightly different format: The message number is always '0000' and instead of the message name a string containing the following parts separated by colons (':') are printed: The debug type, the current C function, the C source file and the line number in the source file.