[Previous] [Contents] [Next]

syslogd

Log system messages

Syntax:

syslogd  [-f config_file] [-m mark_interval]

Options:

-f config_file
Specify the pathname of an alternate configuration file (the default is /etc/syslog.conf).
-m mark_interval
Select the number of minutes between "mark" messages (the default is 20 minutes).

Description:

The syslogd utility reads and logs messages to the system console, log files, other machines and/or users as specified by its configuration file (see below).

Whenever it receives a hangup signal, the syslogd utility closes its output files, reads its configuration file (default is /etc/syslog.conf), and then opens the output files specified by the configuration. The same process is followed at startup, except that there are no files to close.

The utility reads messages from an Internet domain socket specified in /etc/services and receives messages -- via Receive() -- from QNX native processes.

The name qnx/syslog is registered locally so that only local processes can find it (the syslog() function won't do a network-wide search).

To force processes to use a remote syslogd, the SYSLOG environment variable may be set to the desired node number.

The message sent to syslogd should consist of a single line. The message can contain a priority code, which should be a preceding decimal number in angle braces. For example:

<5>

This priority code should map into the priorities defined in the include file sys/syslog.h.

Configuration file

The utility reads its configuration file (syslog.conf) when it starts up and whenever it receives a hangup signal. The file consists of lines with two fields:

The selector field is separated from the action field by one or more tab characters.

The selectors are encoded as a facility, a dot (.), and a level, with no intervening whitespace. Both the facility and the level are case insensitive.

The facility describes the part of the system generating the message, and is one of the following keywords:

These keywords (with the exception of mark) correspond to the similar "LOG_" values specified to the openlog() and syslog() routines.

The level describes the severity of the message, and is a keyword from the following ordered (highest to lowest) list:

These keywords also correspond to the similar "LOG_" values specified to the syslog() routine.

For further descriptions of both the facility and level keywords and their significance, see the syslog() entry in the Watcom C Library Reference.

If a received message matches the specified facility and is of the specified (or a higher) level, then the action specified in the action field will be taken.

Multiple selectors may be specified for a single action by separating them with semicolon (;) characters.


Note: Note that each selector can modify the ones preceding it.

Multiple facilities may be specified for a single level by separating them with comma (,) characters.

An asterisk (*) can be used to specify all facilities or all levels.

The special facility mark receives a message at priority info every 20 minutes.

The special level none disables a particular facility.

The action field of each line specifies the action to be taken when the selector field selects a message. There are four forms:

Blank lines and lines whose first non-blank character is a hash (#) character are ignored.

A configuration file might appear as follows:



# Log all kernel messages, authentication messages of
# level notice or higher and anything of level err or
# higher to the console.
# Don't log private authentication messages!
*.err;kern.*;auth.notice;authpriv.none		/dev/console

# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none				/var/log/messages

# The authpriv file has restricted access.
authpriv.*									/var/log/secure

# Log all the mail messages in one place.
mail.*										/var/log/maillog

# Everybody gets emergency messages, plus log them on another
# machine.
*.emerg										*
*.emerg										@arpa.berkeley.edu

# Root and Eric get alert and higher messages.
*.alert										root,eric

# Save mail and news errors of level err and higher in a
# special file.
uucp,news.crit								/var/log/spoolerr


Note: The effects of multiple selectors aren't always intuitive. For example, mail.crit,*.err will select mail facility messages at the level of err or higher, not at the level of crit or higher.

Files:

/etc/syslog.conf
The configuration file.

Environment variables:

SYSLOG
Used by clients to specify which node to look for syslogd.

See also:

logger

syslog() in the Watcom C Library Reference


[Previous] [Contents] [Next]