Logging

Standard logging mechanism

All of the dæmons in the Internet Utilities write their log output to standard error. They thus leave the disposition of those data up to the user. This provides the user with the choice of what to do with the log output. One can:

Most commands prepend each line of their log output with a timestamp. This timestamp is in a machine-parseable, compact, and timezone-independent form which can be converted into a human-readable time using the UNSTAMP command from the OS/2 Command Line Utilities version 2.2.

Avoid syslog

The Internet Utilities provides a SYSLOGD command that proides a "syslog" UDP service.

Avoid using the "syslog" UDP service if at all possible. It is there for compatibility with badly written programs.

Some programs write their log output by sending it encapsulated in UDP datagrams to a "syslog" dæmon. This design is a poor one, for several reasons:

Fortunately, there is a far better mechanism for logging output. It is called "standard error". This is a very familiar concept that exists on most operating systems. Unix has it. (In fact, error and event logging is one of the purposes for which standard error exists on Unix in the first place.) MS/PC/DR-DOS has it. Even Win32 has it (just barely). IBM OS/2 most definitely has it.

All of the programs in the Internet Utilities use this simple mechanism. None of the programs in the Internet Utilities require the use of the SYSLOGD command.

Some OS/2 programs that use "syslog" also have an option of sending their log output to their standard error instead of to a "syslog" UDP service. It is strongly recommended that this option be enabled in those programs that provide it.

However, some badly written softwares that log to "syslog" cannot be persuaded not to do so. This disease is endemic in Unix softwares — alas! — despite standard error being a well-known Unix mechanism, and so is endemic in ports of those softwares to OS/2. For such programs, the SYSLOGD command provides a remedy, allowing one to turn the stream of UDP datagrams into output to standard error (of the SYSLOGD process) that can then be redirected as desired using the normal file handle redirection mechanisms.

This remedy is necessarily imperfect, since it can do nothing about the potential for loss of log entries or the merging of all of the streams of log information.


The Internet Utilities are © Copyright Jonathan de Boyne Pollard. "Moral" rights are asserted.