Next: , Previous: , Up: Library   [Contents][Index]

5.41 Syslog Interface

The basic means for outputting diagnostic messages is the ‘echo’ instruction (see Echo), which sends its arguments to the currently established logging channel. In daemon mode, the latter is normally connected to syslog, so any echoed messages are sent there with the facility selected in mailfromd configuration and priority ‘info’.

If you want to send a message to another facility and/or priority, use the ‘syslog’ function:

Built-in Function: void syslog (number priority, string text)

Sends text to syslog. The priority argument is formed by ORing the facility and the level values (explained below). The facility level is optional. If not supplied, the currently selected logging facility is used.

The facility specifies what type of program is logging the message, and the level indicates its relative severity. The following symbolic facility values are declared in the syslog module: ‘LOG_KERN’, ‘LOG_USER’, ‘LOG_MAIL’, ‘LOG_DAEMON’, ‘LOG_AUTH’, ‘LOG_SYSLOG’, ‘LOG_LPR’, ‘LOG_NEWS’, ‘LOG_UUCP’, ‘LOG_CRON’, ‘LOG_AUTHPRIV’, ‘LOG_FTP’ and ‘LOG_LOCAL0’ through ‘LOG_LOCAL7

The declared severity levels are: ‘LOG_EMERG’, ‘LOG_ALERT’, ‘LOG_CRIT’, ‘LOG_ERR’, ‘LOG_WARNING’, ‘LOG_NOTICE’, ‘LOG_INFO’ and ‘LOG_DEBUG’.