HP-UX Reference (11i v2 07/12) - 1M System Administration Commands N-Z (vol 4)

s
syslogd(1M) syslogd(1M)
syslogd configures itself when it starts up and whenever it receives a hangup signal. Lines in the
configuration file consist of a selector to determine the message priorities to which the line applies and an
action. The action field is separated from the selector by one or more tabs.
Selectors are semicolon separated lists of priority specifiers. Each priority has a facility indicating the sub-
system that generated the message, a dot, and a level indicating the severity of the message. Symbolic
names can be used. An asterisk selects all facilities. All messages of the specified level or higher (greater
severity) are selected.
More than one facility can be selected, using commas to separate them. For example:
*.emerg;mail,daemon.crit
selects all facilities at the emerg level and the
mail and daemon facilities at the crit level.
The known facilities and levels recognized by
syslogd
are those listed in syslog(3C) converted to lower-
case without the leading
LOG_. The additional facility
mark has a message at priority LOG_INFO sent to
it every 20 minutes (this can be changed with the
-m flag). The mark facility is not enabled by a facility
field containing an asterisk. The level
none can be used to disable a particular facility. For example,
*.debug;mail.none
selects all messages except mail messages.
The second part of each line describes where the message is to be logged if this line is selected. There are
four forms:
A file name (beginning with a leading slash). The file is opened in append mode. If the file does
not exist, it is created.
A host name preceded by an @ character. Selected messages are forwarded to the syslogd on
the named host.
A comma-separated list of users. Selected messages are written to those users terminals if they
are logged in.
An asterisk. Selected messages are written to the terminals of all logged-in users.
Blank lines and lines beginning with a
# character are ignored.
For example, the configuration file:
kern,mark.debug /dev/console
mail.debug /var/adm/syslog/mail.log
*.info;mail.none /var/adm/syslog/syslog.log
*.alert /dev/console
*.alert root,eric,kridle
*.emerg *
*.emerg @admin
logs all kernel messages and 20 minute marks onto the system console, all mail system messages to
/var/adm/syslog/mail.log
, and all messages at info and above, except mail messages, to the file
/var/adm/syslog/syslog.log
. Messages at alert and above are logged to the console and to the
users
root, eric, and kridle if they are logged in. emerg messages are written to all logged-in users
terminals, and forwarded to the host admin.
Only a superuser can invoke syslogd.
Notes
syslogd logs messages into a set of files. Once the size of a log file reaches 2 GB, syslogd stops log-
ging to that file. You can configure the maximum size of syslogd log files by setting the variable
LOG_SIZE in /etc/default/syslogd. The value of LOG_SIZE can be any positive integer greater
than 2, representing the maximum size of the file in GB. When LOG_SIZE=NOLIMIT, syslogd uses
the limit imposed by the file system on file size.
By default
syslogd logs messages until it reaches the first newline character. If you set the variable
NEWLINE_NO_TRUNCATE in /etc/default/syslogd
to 1, syslogd will replace each newline
character in the message, except for the last one, with a blank space.
syslogd assumes the "C" locale by default. By setting MULTIBYTE_ENABLE in
/etc/default/syslogd to 1, syslogd logs messages in a locale-independent fashion as a stream of
bytes. Applications using the services of syslogd can log messages in different locales with this feature.
HP-UX 11i Version 2: December 2007 Update 2 Hewlett-Packard Company 545