From nobody Tue Jul 18 08:07:46 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4R4s4y5V7Vz4nwS4; Tue, 18 Jul 2023 08:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4R4s4y4Z2fz4JbK; Tue, 18 Jul 2023 08:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yg0ifaFJxgw+ha39gWT6Hl9kK80fS5hl9rdzZMkkI3Q=; b=J+aYOVKgOSgrnHuIXPKtuu7ac142FfjzaVEisk5vOLVaNuArxUhoKVxtsAqblMOR4azPMi 1LQVKs2VwE7qRUQeB/erPjL8mvroaW+WHn73Gk8b6odI/dAzkL1l2PUzw2YtqUCV71YfzV KbtsHCxqklXasZAvaWECRkpf+mKJzbxFVLNjMapF/U2sSr2UWpUtBzdCtvExJ7vSKBXsZP /hH2rWQX3JlQ2RKINQI7s5L+WPyJKUphO2+8KNc1cucla73CIUZpVXjeFqoLqSfnxwsrQe 5aSW6CdKOluVo/37Tlk6GSIs5HIhnOzlpXXi0Ruez9ovB1gOWVYMq2p7n7yMLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689667666; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yg0ifaFJxgw+ha39gWT6Hl9kK80fS5hl9rdzZMkkI3Q=; b=JC5T17PZQWE9wWQm/aIAU+v5VstI1ZbBo9CGFsasTH5eFlZo+Ep6+EbIFECprIxTICaJ0+ 5qp0gy3psZlUZPM+XUzpYWnfabDKbCcxY0TqUaNKI/bvZ0/WSY638r51U/QSqGGN3+NbTi g+c+eWeFd2dxFpF3c8Px9JE3E/aikR+Vm0G+sx+jdhuYsg7/o4/StnCVcjK3R4ARaRDqUN InY7lOc+CdZyHZqu5grG7gYsCMeGOyeRQDivEhkrMCJzTMCdIwM9GVLgr7sLkuQIMddZ81 8U/KSRvKn7hnJ3mi1/BRDAYClW0La9Bd2ppZaSL2VFFBKujAdoNbLxuyPXKb6g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689667666; a=rsa-sha256; cv=none; b=sczWvW0kZU/UW79y74tZ8jQTWfoHUsfTtdqFsj096lk+++NDgxt7RlYw0VS3MRStXx4IVu IWq924UODw1Y7lZEUJAQpxeQXvNO02bxXwitZ8/rUFV9FwC7g8kF5IlmlM4CtJ9Whrax90 3wP6CIrandRNDs3hvdF9oUoNRvJSF97UObJBOpTzASYxfn2pxQRSEEwfcHOIhnG4RdUPNN ZIrimH2pKpFhQzt2LG8Nx1kU0O8dmD45jbq6mdJi4NT3wvSz23wdlCOf18Sd18TL+pTpqK /j864ggs3U5IJ7m1VXxuAe94m4Se1ZSXhrs0cBLKQjF8+NIqFOfNpSfXar5hUA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4R4s4y3PJWzyHM; Tue, 18 Jul 2023 08:07:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36I87kEU004427; Tue, 18 Jul 2023 08:07:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36I87kFU004426; Tue, 18 Jul 2023 08:07:46 GMT (envelope-from git) Date: Tue, 18 Jul 2023 08:07:46 GMT Message-Id: <202307180807.36I87kFU004426@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Eugene Grosbein Subject: git: 85c1418ba1c8 - stable/12 - syslog.3: MFC: document ident[N] format List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: eugen X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 85c1418ba1c827a73c04689fceb4edd1ab0eea64 Auto-Submitted: auto-generated The branch stable/12 has been updated by eugen: URL: https://cgit.FreeBSD.org/src/commit/?id=85c1418ba1c827a73c04689fceb4edd1ab0eea64 commit 85c1418ba1c827a73c04689fceb4edd1ab0eea64 Author: Eugene Grosbein AuthorDate: 2023-07-03 12:35:37 +0000 Commit: Eugene Grosbein 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