Austin Group Defect Tracker

Aardvark Mark IV

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000917 [1003.1(2013)/Issue7+TC1] Shell and Utilities Editorial Enhancement Request 2015-02-02 11:30 2020-04-03 15:15
Reporter rhymoid View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Stijn van Drongelen
User Reference
Section logger
Page Number 2878-2879
Line Number 94786-94861
Interp Status ---
Final Accepted Text Note: 0002626
Summary 0000917: specified 'logger' does not match actual usage
Description After a bit of searching, it seems that UnixWare is the only software distribution that claims POSIX adherence _and_ implements a truly POSIX-compliant version of the 'logger' utility.

Any other distribution seems to follow BSD's lead, because that variant is simply more useful. Unlike the specified logger, BSD's logger conforms to the Utility Syntax Guidelines, and seem to have a few options in common:

* -f {file}: log the lines of the specified
* -i: record the process ID of logger along with the message
* -p {facility}.{level}: set the facility and level of the logged message; defaults to "user.notice"
* -t {tag}: tag the message (seems to default to a implementation-defined format)

These options map trivially to openlog() and syslog() calls. The only weirdness is what happens when both or neither -f and a message is provided (neither: message is taken from standard input, breaking compatibility with the specified logger in yet another way; both: unspecified behaviour?).

Now, as for implementation, logger should be a frontend to <syslog.h> on XSI-compliant systems, in my opinion.
Desired Action * Investigate the current actual implementation of the logger utility.
* Update the standard to reflect the command line syntax for logger in actual use. Preferably, follow the Utility Syntax Guidelines.
* Update the standard to require equivalence to appropriate calls to openlog() and syslog() on XSI-compliant systems.
Tags issue8
Attached Files

- Relationships

-  Notes
geoffclare (manager)
2015-02-02 16:06

The claim that UnixWare is the only system that claims POSIX adherence and has a "truly POSIX-compliant" implementation of the logger utility is not correct and is most likely the result of a misunderstanding of what POSIX requires (and allows).

In particular, although POSIX does not require logger to conform to the Utility Syntax Guidelines and does not mandate any options, it requires logger to accept an initial "--" argument so that applications can pass a string operand beginning with "-" to implementations of logger that accept (as an allowed extension) one or more options. See XCU 1.4 Utility Description Defaults, under OPTIONS -> Default Behavior.

Also, since the SYNOPSIS requires that applications pass at least one string operand to logger, any differences in behaviour of logger implementations when no operands are passed does not constitute non-conformance with POSIX.

Having said all that, I would not oppose enhancing logger in Issue 8 along the lines proposed (with XSI shading on any requirements relating logger to openlog() and syslog()).
rhansen (manager)
2015-04-16 16:37

On page 2878 line 94786 (logger synopsis), change:
logger string...
logger [-i] [-f file] [-p priority] [-t tag] [string...]
On page 2878 lines 94788-94790 (logger DESCRIPTION), change:
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.
The logger utility shall send messages to an implementation-defined logging facility, which may log them in an implementation-defined system log, write them to the system console, forward them to a list of users, or forward them to the logging facility on another host over the network. Each logged message shall include a message header and a message body. The message header contains at least a timestamp and a tag string.

If one or more string operands are specified, they shall be logged; otherwise, the message bodies to be logged shall be read from standard input if no -f option is specified, or from the specified file if the -f option is present.
On page 2878 line 94794 (logger options), change:
The logger utility shall conform to XBD Section 12.2 (on page 215).

The following options shall be supported:
  • -f file
    Read the log message bodies from file instead of standard input.
  • -i
    Log the process ID of the logger process with each message.
  • -p priority
    Log the message with priority set to priority. The priority is specified as a facility.level pair. The following values for facility shall be supported:
    • user Messages generated by arbitrary processes.
    • local0 Reserved for local use.
    • local1 Reserved for local use.
    • local2 Reserved for local use.
    • local3 Reserved for local use.
    • local4 Reserved for local use.
    • local5 Reserved for local use.
    • local6 Reserved for local use.
    • local7 Reserved for local use.
    The following values for level shall be supported:
    • emerg A panic condition.
    • alert A condition that should be corrected immediately, such as a corrupted system database.
    • crit Critical conditions, such as hard device errors.
    • err Errors.
    • warning Warning messages.
    • notice Conditions that are not error conditions, but that may require special handling.
    • info Informational messages.
    • debug Messages that contain information normally of use only when debugging a program.
    If the -p option is not specified, the priority shall be user.notice.
  • -t tag
    Use the string tag as the tag string in the message header. The default tag is unspecified.
On page 2878 line 94800 (logger STDIN), change:
Not used.
The standard input shall be used if no string operands are specified and either the -f option is not specified or the -f option is specified with a file option-argument of '-' and the implementation treats the '-' as meaning standard input. Otherwise, the standard input shall not be used. See the INPUT FILES section.

Each non-empty line shall be logged as a separate message. It is unspecified whether an empty line is also logged as a separate message.
On page 2878 line 94802 (logger input files), change:
The input files shall be text files.

- Issue History
Date Modified Username Field Change
2015-02-02 11:30 rhymoid New Issue
2015-02-02 11:30 rhymoid Name => Stijn van Drongelen
2015-02-02 11:30 rhymoid Section => logger
2015-02-02 11:30 rhymoid Page Number => .
2015-02-02 11:30 rhymoid Line Number => .
2015-02-02 16:06 geoffclare Note Added: 0002534
2015-04-02 16:45 Don Cragun Page Number . => 2878-2879
2015-04-02 16:45 Don Cragun Line Number . => 94786-94861
2015-04-02 16:45 Don Cragun Interp Status => ---
2015-04-16 16:37 rhansen Note Added: 0002626
2015-04-16 16:40 rhansen Final Accepted Text => Note: 0002626
2015-04-16 16:40 rhansen Status New => Closed
2015-04-16 16:40 rhansen Resolution Open => Accepted As Marked
2015-04-16 16:40 rhansen Tag Attached: issue8
2015-04-16 16:44 rhansen Status Closed => Resolved
2020-04-03 15:15 geoffclare Status Resolved => Applied

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker