|
|
STREAMS error and trace loggers are provided for debugging and for administering STREAMS modules and drivers. This facility consists of log(7), strace, strclean, strerr, and the strlog function.
Any module or driver in any Stream can call the STREAMS logging function strlog, described in log(7). When called, strlog sends formatted text to the error logger strerr, the trace logger strace, or the console logger.
Error and Trace Logging
strerr is intended to operate as a daemon process initiated at system startup. A call to strlog requesting an error to be logged causes an M_PROTO(D7str) message to be sent to strerr, which formats the contents and places them in a daily file. The utility strclean is provided to purge daily log files that have not been modified for three days.
A call to strlog requesting trace information to be logged causes a similar M_PROTO message to be sent to strace, which places it in a user designated file. strace is intended to be initiated by a user. The user can designate the modules/drivers and severity level of the messages to be accepted for logging by strace.
A user process can submit its own M_PROTO messages to the log driver for inclusion in the logger of its choice through putmsg. The messages must be in the same format required by the logging processes and will be switched to the logger(s) requested in the message.
The output to the log files is formatted, ASCII text. The files can be processed by standard system commands such as grep or ed, or by developer-provided routines.