LOGGER(1) General Commands Manual LOGGER(1)

loggerlog messages

logger string ...

The logger utility saves a message, in an unspecified manner and format, containing the string operands provided by the user. The messages are expected to be evaluated later by personnel performing system administration tasks.

None.

The following operands shall be supported by the implementation:

string

One of the string arguments whose contents are concatenated together, in the order specified, separated by single <space>s.

None.

None.

The following environment variables shall affect the execution of logger:

This variable shall determine the locale to use for the locale categories when both LC_ALL and the corresponding environment variable (beginning with LC_ ) do not specify a locale. See 2.6.

This variable shall determine the locale to be used to override any values for locale categories specified by the settings of LANG or any environment variables beginning with LC_.

This variable shall determine the locale for the interpretation of sequences of bytes of text data as characters (e.g., single- versus multibyte characters in arguments).

This variable shall determine the language in which diagnostic messages should be written.

Default.

None.

Used only for diagnostic messages.

Unspecified.

None.

The logger utility shall exit with one of the following values:

Successful completion.

An error occurred.

Default.

This utility allows logging of information for later use by a system administrator or programmer in determining why noninteractive utilities have failed. POSIX. 2 makes no requirements for the locations of the saved message, their format, or retention period. It also provides no method for a portable application to read messages, once written. (It is expected that the POSIX. 7 System Administration standard will have something to say about that.) The purpose of this utility might best be illustrated by an example. A batch application, running noninteractively, tries to read a configuration file and fails; it may attempt to notify the system administrator with: logger myname: unable to read file foo. [time stamp] The text with LC_MESSAGES about diagnostic messages means diagnostics from logger to the user or application, not diagnostic messages that the user is sending to the system administrator.

Multiple string arguments were allowed, similar to echo, for ease of use. In Draft 9, the posixlog utility was renamed logger to match its forebear, with which it is (downward) compatible. The working group believed strongly that some method of alerting administrators to errors was necessary. The obvious example is a batch utility, running noninteractively, that is unable to read its configuration files, or that is unable to create or write its results file. However, the working group did not wish to define the format or delivery mechanisms as they have historically been (and will probably continue to be) very system specific, as well as involving functionality clearly outside of the scope of this standard. Like the utilities mailx and lp, logger is admittedly difficult to test. This was not deemed sufficient justification to exclude these utilities from the standard. It is also arguable that they are, in fact, testable, but that the tests themselves are not portable.

September 1991 posix.fail