Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2ur7-007jPF-QC for pgsql-general@arkaria.postgresql.org; Thu, 10 Apr 2025 16:34:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1u2ur6-00EQiZ-8u for pgsql-general@arkaria.postgresql.org; Thu, 10 Apr 2025 16:34:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1u2ur5-00EQiQ-Pc for pgsql-general@lists.postgresql.org; Thu, 10 Apr 2025 16:34:20 +0000 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1u2ur3-0045ZI-2v for pgsql-general@lists.postgresql.org; Thu, 10 Apr 2025 16:34:19 +0000 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-2c759bf1b2eso509320fac.1 for ; Thu, 10 Apr 2025 09:34:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744302857; x=1744907657; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=m9iVNToSy6eWCBgkTPMNLbtW2p+6vlRCr3euCwoV6O0=; b=Vu7BKx3vlVpEbra+FZwkS4YwpH8fq5lAoeUEfwyrbmoKXLvYktX/SfW1gunvXAoUzN HXf/yugHztwGOOwl1AvNzuK9nZWClo39AhXJgMzKhL4/Ics7OZgEk9jvs/0sDLo113Kg m77aLMt4U9HbddYf8r3KC31td6EpKsf/SciT4rElaaqAFfUwWSvWdmlmnMAI886iSGVB U0z5AONKCYpx8j7tGJ8B9+veut0t6HreWZo9AlHhiVZX8EAxmCRI4afkde3YPN5zLWK/ sG2xFKdWxLTcGMzo6CKWSjmSDzKTAMiXSUh7p9KknERm1ORgKe9Sx1CR/pgZF9V+7oH/ LNEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744302857; x=1744907657; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m9iVNToSy6eWCBgkTPMNLbtW2p+6vlRCr3euCwoV6O0=; b=Bc42kzkX5qiALwgFuTktsWaI3t2A/WDV94YQJVomQ69fMODaE6RJH1yi/NRnfsq/s/ tXCW9pG8lFkaDyYrMNs2lmA3DX47hgee8YNqGiW5IoXAThREDEBRYsdF3qbbPvKQ+oYX nrAYyd9hd00BlBq7oOS/Itnnywb7lJ8GPVppkq+iUxufK+zsqOkUTy8psVmOiOegsH3j ehrEs9hVKKPiwVdtAqXSVxFtAWEqThzQGMqEwId3cXOVQYgmz3e5zMmy3K69B3qnxdx5 Na0r193Upcl/tz9Hr47/f3dGmAClnsWZEw4LzVnygnjTSpdEqkWzDA2J6kKL/4E5UlfM VjVw== X-Gm-Message-State: AOJu0YxzZM9VoNuaKXw9HmRNoktbErYTEDD2+n6Gv3qDQfH9GJx3EDOP atxn/bP4HA8xQNIogNweWxwv946wGUxQd6TeZc00oY4X4RBKzNnhkRT6iLbTLINFCYaxvPX7iNH y+Rog1+iOTwgWIX+KeJuKXrexO3hHAZQ8 X-Gm-Gg: ASbGncuPq8fCZV3kj5nyRTnUQ66oVnPawTlleptJfJyenp3+1/EBZLs0Vr5TUmKGNkd op+dNgLUaDd0MR3hqAg5rubOMnHo+SIHLnMnqz8UeggAFgEH9sOwrrZfPDYy/SlG8ln/XlNyKF6 YFhativNvEzppgVcVxk19V X-Google-Smtp-Source: AGHT+IG//GodFYrHSP/H9T9GNx7orblvl6if1VAhDEZMYTRn11iuixxj4qX4wFYp1ESCR7R64DGZa+tXXRULx+kbBmA= X-Received: by 2002:a05:6870:6f13:b0:296:bbc8:4a82 with SMTP id 586e51a60fabf-2d0b5d7f719mr1776783fac.27.1744302857128; Thu, 10 Apr 2025 09:34:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "David G. Johnston" Date: Thu, 10 Apr 2025 09:33:39 -0700 X-Gm-Features: ATxdqUEM-rK7A7o_uBuOf5Kbvy1BDa0RKkGR-KUJmO3vAJtVbsYv2YkmXUwzZzw Message-ID: Subject: Re: Capturing both IP address and hostname in the log To: "Tefft, Michael J" Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="0000000000002e19b706326f2886" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002e19b706326f2886 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Apr 10, 2025 at 5:22=E2=80=AFAM Tefft, Michael J wrote: > The documentation for log_hostname says: > > log_hostname (boolean) > > By default, connection log messages only show the IP address of the > connecting host. Turning this parameter on causes logging of the host nam= e > as well. Note that depending on your host name resolution setup this migh= t > impose a non-negligible performance penalty. This parameter can only be s= et > in the postgresql.conf file or on the server command line. > > > > https://www.postgresql.org/docs/14/runtime-config-logging.html > > > Yeah, the wording really should be more like: diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index fea683cb49..c545fee6c9 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -7614,10 +7614,11 @@ local0.* /var/log/postgresql - By default, connection log messages only show the IP address of th= e - connecting host. Turning this parameter on causes logging of the - host name as well. Note that depending on your host name resolution - setup this might impose a non-negligible performance penalty. + By default, for TCP/IP-originated connections, the identifier of the host + making the connection is its IP address. Turning this parameter on tells + the system to record the resolved host name instead. Note that depending + on your host name resolution setup this might impose a non-negligible + performance penalty. This parameter can only be set in the postgresql.conf file or on the server command line. Both the connection logging routine and log_line_prefix %h / %r simply report the "identifier of the host making the connection". David J. --0000000000002e19b706326f2886 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Apr 10, 2025 at 5:22=E2=80=AFAM Tefft, Michael J &= lt;Michael.J.Tefft@snapon.com= > wrote:

The documentation for= log_hostname=C2=A0says:

log_hostname=C2=A0(bo= olean)<= u>

By default, connectio= n log messages only show the IP address of the connecting host. Turning thi= s parameter on causes logging of the host name as well. Note that depending= on your host name resolution setup this might impose a non-negligible performance penalty. This parameter can= only be set in the=C2=A0postgresql.conf=C2=A0file or on the server command= line.

=C2=A0<= /span>

htt= ps://www.postgresql.org/docs/14/runtime-config-logging.html



Yeah, the wording really should be more like:

dif= f --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index fea6= 83cb49..c545fee6c9 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/sr= c/sgml/config.sgml
@@ -7614,10 +7614,11 @@ local0.* =C2=A0 =C2=A0/var/lo= g/postgresql
=C2=A0 =C2=A0 =C2=A0 =C2=A0</term>
=C2=A0 =C2=A0 = =C2=A0 =C2=A0<listitem>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 <para>- =C2=A0 =C2=A0 =C2=A0 =C2=A0By default, connection log messages only sho= w the IP address of the
- =C2=A0 =C2=A0 =C2=A0 =C2=A0connecting host. Tu= rning this parameter on causes logging of the
- =C2=A0 =C2=A0 =C2=A0 =C2= =A0host name as well.=C2=A0 Note that depending on your host name resolutio= n
- =C2=A0 =C2=A0 =C2=A0 =C2=A0setup this might impose a non-negligible = performance penalty.
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0By default, for TCP/IP= -originated connections, the identifier of the host
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0making the connection is its IP address.=C2=A0 Turning this param= eter on tells
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0the system to record the reso= lved host name instead.=C2=A0 Note that depending
+ =C2=A0 =C2=A0 =C2=A0= =C2=A0on your host name resolution setup this might impose a non-negligibl= e
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0performance penalty.
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0This parameter can only be set in the <filename>post= gresql.conf</filename>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0file or o= n the server command line.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </para>


Both the connection logging routine and log_= line_prefix %h / %r simply report the "identifier of the host making t= he connection".

David J.

--0000000000002e19b706326f2886--