NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/43300: syslog(3): LOG_PID inconsistency

>Number:         43300
>Category:       lib
>Synopsis:       syslog(3): LOG_PID inconsistency
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu May 13 14:20:00 +0000 2010
>Originator:     Takahiro Kambe
>Release:        NetBSD 5.99.29
Takahiro Kambe
System: NetBSD 5.99.29 NetBSD 5.99.29 (VMWARE-F3-MONO) 
#11: Fri May 7 15:16:09 JST 2010
Architecture: i386
Machine: i386
        syslog(3) was updated to support RFC5424 and syslog(3)'s behavior
        was changed when LOG_PERROR was specified.  And description about
        LOG_PID isn't match with current behavior.
        Here is sample program.

#include <syslog.h>
#include <stdlib.h>

main(int argc, char **argv)
        openlog("test", LOG_PID | LOG_PERROR, LOG_DAEMON);
        syslog(LOG_DEBUG, "This is a test message.");

        On NetBSD 5.1_RC1:

test[24604]: This is a test message.

        On NetBSD 5.99.29:

test 27496 - - This is a test message.

        I think latter refrects syslog message format of RFC5424. But at
        the same time, syslog(3) says

     LOG_PID       Log the process id with each message: useful for identify-
                   ing instantiations of daemons.  (This PID is placed within
                   brackets between the ident and the message.)

        It is correct for the effect of LOG_PID to a log file of syslogd(8)
        but not for output by LOG_PERROR.

        Fix documentation of syslog(3) or make syslog(3) to output as

test[27496] - - This is a test message.


test[27496]: - - This is a test message.


Home | Main Index | Thread Index | Old Index