NAME
logger — log
messages
SYNOPSIS
logger |
string ... |
DESCRIPTION
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.
OPTIONS
None.
OPERANDS
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.
STANDARD INPUT
None.
INPUT FILES
None.
ENVIRONMENT VARIABLES
The following environment variables shall affect the execution of
logger:
LANG-
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.
LC_ALL-
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_.
LC_CTYPE-
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).
LC_MESSAGES-
This variable shall determine the language in which diagnostic messages should be written.
ASYNCHRONOUS EVENTS
Default.
STANDARD OUTPUT
None.
STANDARD ERROR
Used only for diagnostic messages.
OUTPUT FILES
Unspecified.
EXTENDED DESCRIPTION
None.
EXIT STATUS
The logger utility shall exit with one of
the following values:
CONSEQUENCES OF ERRORS
Default.
RATIONALE
EXAMPLES
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.
HISTORY OF DECISIONS MADE
Multiple string arguments were allowed, similar to echo, for ease
of use. In Draft 9, the posixlog utility was renamed
logger to match its
BSD
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.