Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Jul 2023 08:07:46 GMT
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 85c1418ba1c8 - stable/12 - syslog.3: MFC: document ident[N] format
Message-ID:  <202307180807.36I87kFU004426@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by eugen:

URL: https://cgit.FreeBSD.org/src/commit/?id=85c1418ba1c827a73c04689fceb4edd1ab0eea64

commit 85c1418ba1c827a73c04689fceb4edd1ab0eea64
Author:     Eugene Grosbein <eugen@FreeBSD.org>
AuthorDate: 2023-07-03 12:35:37 +0000
Commit:     Eugene Grosbein <eugen@FreeBSD.org>
CommitDate: 2023-07-18 08:07:04 +0000

    syslog.3: MFC: document ident[N] format
    
    When libc switched to generation of logs as per RFC 5424,
    that change broke application ability to insert specific process id
    using ident[N] format, the feature existed for decades.
    Some processes rely on it (including logger and syslogd).
    
    Later the regression was fixed but the feature remained undocumented.
    This change documents it.
    
    (cherry picked from commit 5aee3e14d4914c7c99bce80da17b3100cb1f4490)
---
 lib/libc/gen/syslog.3   | 7 ++++++-
 usr.bin/logger/logger.1 | 9 ++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/lib/libc/gen/syslog.3 b/lib/libc/gen/syslog.3
index 5738d362bd0c..8a4104ab5f12 100644
--- a/lib/libc/gen/syslog.3
+++ b/lib/libc/gen/syslog.3
@@ -28,7 +28,7 @@
 .\"     @(#)syslog.3	8.1 (Berkeley) 6/4/93
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2018
+.Dd July 3, 2023
 .Dt SYSLOG 3
 .Os
 .Sh NAME
@@ -130,6 +130,11 @@ The
 .Fa ident
 argument
 is a string that will be prepended to every message.
+It may be formatted as
+.Fa ident[N]
+in which case decimal number
+.Fa N
+replaces the process id within messages.
 The
 .Fa logopt
 argument
diff --git a/usr.bin/logger/logger.1 b/usr.bin/logger/logger.1
index 7a64320cfe49..a2774b9e3500 100644
--- a/usr.bin/logger/logger.1
+++ b/usr.bin/logger/logger.1
@@ -28,7 +28,7 @@
 .\"	@(#)logger.1	8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd December 5, 2017
+.Dd July 3, 2023
 .Dt LOGGER 1
 .Os
 .Sh NAME
@@ -73,6 +73,9 @@ tries to send the message to all addresses.
 .It Fl i
 Log the process id of the logger process
 with each line.
+This flag is ignored and the process id is always logged.
+See also
+.Fl t .
 .It Fl s
 Log the message to standard error, as well as the system log.
 .It Fl f Ar file
@@ -152,6 +155,10 @@ and
 Mark every line in the log with the specified
 .Ar tag
 rather than the default of current login name.
+Use
+.Fl t Ar tag[N]
+to insert specific decimal process id instead of id of
+.Nm .
 .It Ar message
 Write the message to log; if not specified, and the
 .Fl f



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307180807.36I87kFU004426>