HP-UX Reference (11i v2 07/12) - 7 Device (Special) Files, 9 General Information, Index (vol 10)

s
strlog(7) strlog(7)
NAME
strlog - STREAMS log driver
DESCRIPTION
The STREAMS log driver allows user-level processes and STREAMS drivers and modules to perform error
logging and event tracing. These tasks are done via a user interface and a kernel interface. Further, the
STREAMS log driver delivers error logging and event tracing messages to the Network Tracing and Log-
ging Facility (NetTL) (see nettl(1M), netfmt(1M), and nettlconf(1M)).
The interface that this driver presents to user-level processes is a subset of the
ioctl() system calls and
STREAMS message formats. These processes can be error loggers, trace loggers, or other user processes,
that generate error or event messages. The user interface collects log messages from the log driver, and
also generates log messages from user processes.
The driver also accepts log messages from STREAMS drivers and modules in the kernel via its function call
interface. The kernel interface enters requests or calls from STREAMS drivers and modules into log mes-
sages.
The log messages accepted by the log driver are also delivered to NetTL. NetTL can be used to control
which types of messages to log, and to format and filter the logged messages.
Kernel Interface
STREAMS drivers and modules generate log messages by calls to the
strlog function.
#include <sys/strlog.h>
int strlog (mid, sid, level, flags, fmt [, value ]...);
short mid;
short sid;
char level;
ushort flags;
char *fmt;
int value;
mid specifies the STREAMS module ID number for the driver or module submitting the log message.
sid specifies the sub-ID number of a minor device associated with the STREAMS module or driver
identified by mid.
level specifies a level for screening lower-level event messages from a tracer.
flags contains several flags that can be set in various combinations. The flags are as follows:
SL_ERROR The message is for the error logger.
SL_TRACE The message is for the tracer.
SL_CONSOLE The message will be printed to the console.
SL_FATAL Provides a notification of a fatal error.
SL_NOTIFY Makes a request to mail a copy of a message to the system administrator.
The following are additional flags. These flags are not used by strerr or strace.
However, they are used to map STREAMS messages to NetTL messages as described below
in "STREAMS-NetTL Link" section.
SL_WARN The message is a warning.
SL_NOTE The message is a note.
fmt is a printf style format string. This accepts the %x, %l, %o, %u, %d, %c, and %s conversion
specifications.
values are numeric or character arguments for the format string. There is no maximum number of
arguments that can be specified.
User Interface
User processes access the log driver with an open() call to /dev/strlog . Each open to the device will
obtain a separate stream. After a process opens /dev/strlog , it indicates whether it is an error logger
HP-UX 11i Version 2: December 2007 Update 1 Hewlett-Packard Company 181